library(escalation)
## Loading required package: magrittr
p1 <- get_three_plus_three(num_doses=1, allow_deescalate=TRUE) %>%
get_dose_paths(cohort_sizes=rep(3, 2)) # D=1 trial enrolls at most 2 cohorts
g1 <- graph_paths(p1)
g1$width <- g1$height <- 250
g1
p2 <- get_three_plus_three(num_doses=2, allow_deescalate=TRUE) %>%
get_dose_paths(cohort_sizes=rep(3, 4)) # D=2 trial enrolls at most 4 cohorts
## You have requested 341 model evaluations. Be patient.
graph_paths(p2)
set.seed(2020)
true_prob_tox <- c(0, 0, 0) # drive simulation to top dose with zero toxicity
num_sims <- 1
sims <- get_three_plus_three(num_doses = 3, allow_deescalate = TRUE) %>%
simulate_trials(num_sims = num_sims, true_prob_tox = true_prob_tox)
sims[[1]][[1]][[1]]$fit
## Patient-level data:
## # A tibble: 9 × 4
## Patient Cohort Dose Tox
## <int> <int> <int> <int>
## 1 1 1 1 0
## 2 2 1 1 0
## 3 3 1 1 0
## 4 4 2 2 0
## 5 5 2 2 0
## 6 6 2 2 0
## 7 7 3 3 0
## 8 8 3 3 0
## 9 9 3 3 0
##
## Dose-level data:
## # A tibble: 4 × 8
## dose tox n empiric_tox_rate mean_prob_tox median_prob_tox admissible
## <ord> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl>
## 1 NoDose 0 0 0 0 0 TRUE
## 2 1 0 3 0 NA NA TRUE
## 3 2 0 3 0 NA NA TRUE
## 4 3 0 3 0 NA NA TRUE
## # … with 1 more variable: recommended <lgl>
##
## The model advocates stopping and recommending dose 3.
Korn, Edward L., Douglas Midthune, T. Timothy Chen, Lawrence V. Rubinstein, Michaele C. Christian, and Richard M. Simon. 1994. “A Comparison of Two Phase I Trial Designs.” Statistics in Medicine 13 (18): 1799–1806. https://doi.org/10.1002/sim.4780131802.