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, ...)

Arguments

x

Object of type selector.

...

Extra args are passed onwards.

Value

tibble, which acts like a data.frame.

Examples

# 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 × 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     1
#> 6       6      2     2     0

# 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 × 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     1
#> 6       6      2     2     0