# NOT RUN {
# }
# NOT RUN {
### Only one simulation
DLT <- 0
dose <- 20
step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete',
theta = 0.33, alpha = 0.25,
min_dose = 20, max_dose = 100,
dose_set = seq(20, 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 = 60, theta = 0.33,
min_dose = 20, max_dose = 100)
sim <- ewoc_simulation(step_zero = step_zero,
n_sim = 1, sample_size = 30, n_cohort = 1,
alpha_strategy = "conditional",
response_sim = response_sim,
fixed_first_cohort = TRUE,
ncores = 1)
pdlt <- pdlt_d1classical(rho = 0.05, mtd = 60, theta = 0.33,
min_dose = 20, max_dose = 100)
opc(sim_list = list(sim), pdlt_list = list(pdlt),
mtd_list = list(60), toxicity_margin = 0.05, mtd_margin = 6)
### Two or more simulations
sim_list <- list()
mtd_list <- list()
pdlt_list <- list()
DLT <- 0
dose <- 20
step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete',
theta = 0.33, alpha = 0.25,
min_dose = 20, max_dose = 100,
dose_set = seq(20, 100, 20),
rho_prior = matrix(1, ncol = 2, nrow = 1),
mtd_prior = matrix(1, ncol = 2, nrow = 1),
rounding = "nearest")
mtd_list[[1]] <- 60
response_sim <- response_d1classical(rho = 0.05, mtd = mtd_list[[1]],
theta = 0.33,
min_dose = 20, max_dose = 100)
sim_list[[1]] <- ewoc_simulation(step_zero = step_zero,
n_sim = 1, sample_size = 30, n_cohort = 1,
alpha_strategy = "conditional",
response_sim = response_sim,
fixed_first_cohort = TRUE,
ncores = 1)
pdlt_list[[1]] <- pdlt_d1classical(rho = 0.05, mtd = mtd_list[[1]],
theta = 0.33,
min_dose = 20, max_dose = 100)
mtd_list[[2]] <- 40
response_sim <- response_d1classical(rho = 0.05, mtd = mtd_list[[2]],
theta = 0.33,
min_dose = 20, max_dose = 100)
sim_list[[2]] <- ewoc_simulation(step_zero = step_zero,
n_sim = 1, sample_size = 30, n_cohort = 1,
alpha_strategy = "conditional",
response_sim = response_sim,
fixed_first_cohort = TRUE,
ncores = 1)
pdlt_list[[2]] <- pdlt_d1classical(rho = 0.05, mtd = mtd_list[[2]],
theta = 0.33,
min_dose = 20, max_dose = 100)
opc(sim_list = sim_list, pdlt_list = pdlt_list,
mtd_list = mtd_list, toxicity_margin = 0.05, mtd_margin = 6)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab