Get the model data-frame for a dose-finding analysis, inlcuding columns for patient id, cohort id, dose administered, and toxicity outcome. In some scenarios, further columns are provided.
model_frame(x, ...)
Object of type selector
.
Extra args are passed onwards.
tibble
, which acts like a data.frame
.
# In a toxicity-only setting:
skeleton <- c(0.05, 0.1, 0.25, 0.4, 0.6)
target <- 0.25
model <- get_dfcrm(skeleton = skeleton, target = target)
fit <- model %>% fit('1NNN 2NTN')
fit %>% model_frame()
#> # A tibble: 6 × 5
#> patient cohort dose tox weight
#> <int> <int> <int> <int> <dbl>
#> 1 1 1 1 0 1
#> 2 2 1 1 0 1
#> 3 3 1 1 0 1
#> 4 4 2 2 0 1
#> 5 5 2 2 1 1
#> 6 6 2 2 0 1
# In an efficacy-toxicity setting
prob_select = c(0.1, 0.3, 0.5, 0.07, 0.03)
model <- get_random_selector(prob_select = prob_select,
supports_efficacy = TRUE)
x <- model %>% fit('1NTN 2EN 5BB', supports_efficacy = TRUE)
fit %>% model_frame()
#> # A tibble: 6 × 5
#> patient cohort dose tox weight
#> <int> <int> <int> <int> <dbl>
#> 1 1 1 1 0 1
#> 2 2 1 1 0 1
#> 3 3 1 1 0 1
#> 4 4 2 2 0 1
#> 5 5 2 2 1 1
#> 6 6 2 2 0 1