Percent of doses in relation the optimal toxicity interval
Calculate the percent of doses which are inside the optimal toxicity interval [target rate - margin ; target rate + margin]
.
optimal_toxicity(dose_matrix, target_rate, margin, pdlt, digits = 2)
dose_matrix
: a numerical matrix of assigned doses for each step of the trial (column) and for each trial (row).target_rate
: a numerical value of the target DLT rate.margin
: a numerical value of the acceptable margin of distance from the target_rate
.pdlt
: a function to calculate the probability of toxicity with a numeric vector of doses as input and a numeric vector of probabilities as output.digits
: a numerical value indicating the number of digits.interval
the average percent of doses which are inside the optimal toxicity interval.
underdose
the average percent of doses which are smaller than the lower limit of the optimal toxicity interval.
overdose
the average percent of doses which are greater than the upper limit of the optimal toxicity interval.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) pdlt_sim <- pdlt_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) optimal_toxicity(sim$mtd_sim, target_rate = 0.33, margin = 0.05, pdlt = pdlt_sim) optimal_toxicity(sim$dose_sim, target_rate = 0.33, margin = 0.05, pdlt = pdlt_sim) ## End(Not run)