The escalation
package by Kristian Brock. Documentation is hosted at https://brockk.github.io/escalation/
To provide dose selection decisions, the escalation
package daisy-chains together objects that support a common interface, each deriving from type selector
. This vignette demonstrates the entire interface supported by selector
objects. For the purpose of illustratration, we use a BOIN selector but the same functions will work on every type of dose selector in escalation
.
Target toxicity rate:
The number of patients treated:
Cohort IDs for the treated patients:
The code infers from the spaces in the outcome string that a dose-decision was made after the second, fourth , and sixth patients.
Integers representing the dose-levels given:
Bits representing whether toxicity event was observed:
The total number of toxicities seen at all doses combined:
A data-frame containing the above information:
model_frame(fit)
#> # A tibble: 8 x 4
#> patient cohort dose tox
#> <int> <int> <int> <int>
#> 1 1 1 1 0
#> 2 2 1 1 0
#> 3 3 2 2 0
#> 4 4 2 2 0
#> 5 5 3 3 0
#> 6 6 3 3 1
#> 7 7 4 2 0
#> 8 8 4 2 1
The number of doses under investigation:
The indices of the dose-levels under investigation:
The dose-level recommended for the next patient:
After seeing some toxicity at doses 2 and 3, the design sensibly sticks at dose 2 for the time being.
A logical value for whether accrual should continue:
We infer from this that no stopping condition has yet been triggered.
The number of patients treated at each dose:
The number of patients treated at the recommended dose:
The proportion of patients treated at each dose:
The total number of toxicities seen at each dose:
The empirical toxicity rate, i.e. the number of toxicities divided by the number of patients:
The model-derived expected toxicity rate at each dose:
The BOIN design makes no estimate for doses it has not yet administered.
The model-derived median toxicity rate at each dose:
BOIN does not actually calculate posterior median estimates. Sometimes it will be necessary to return missing values if functionality is not supported by a model. Median estimates could be added to the BOIN class in due course.
The model-derived quantile of the toxicity rate at each dose:
BOIN does not calculate this either. It could also be added.
The posterior probability that the toxicity rate exceeds some threshold value, here 50%:
Once again, no estimate is made for non-administered doses. We see that the model estimates a trivial chance that the toxicity rate at the lowest dose exceeds 50%.
Learn if this model supports sampling from the posterior:
The BOIN model does not support sampling. If it did, we could run prob_tox_samples(fit)
.
We can also call some standard generic functions:
print(fit)
#> Patient-level data:
#> # A tibble: 8 x 4
#> Patient Cohort Dose Tox
#> <int> <int> <int> <int>
#> 1 1 1 1 0
#> 2 2 1 1 0
#> 3 3 2 2 0
#> 4 4 2 2 0
#> 5 5 3 3 0
#> 6 6 3 3 1
#> 7 7 4 2 0
#> 8 8 4 2 1
#>
#> Dose-level data:
#> # A tibble: 6 x 8
#> dose tox n empiric_tox_rate mean_prob_tox median_prob_tox admissible
#> <ord> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl>
#> 1 NoDo… 0 0 0 0 0 TRUE
#> 2 1 0 2 0 0.02 0.01 TRUE
#> 3 2 1 4 0.25 0.26 0.21 TRUE
#> 4 3 1 2 0.5 0.5 0.5 TRUE
#> 5 4 0 0 NaN NA NA TRUE
#> 6 5 0 0 NaN NA NA TRUE
#> # … with 1 more variable: recommended <lgl>
#>
#> The model targets a toxicity level of 0.3.
#> The model advocates continuing at dose 2.
summary(fit)
#> # A tibble: 6 x 8
#> dose tox n empiric_tox_rate mean_prob_tox median_prob_tox admissible
#> <ord> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl>
#> 1 NoDo… 0 0 0 0 0 TRUE
#> 2 1 0 2 0 0.02 0.01 TRUE
#> 3 2 1 4 0.25 0.26 0.21 TRUE
#> 4 3 1 2 0.5 0.5 0.5 TRUE
#> 5 4 0 0 NaN NA NA TRUE
#> 6 5 0 0 NaN NA NA TRUE
#> # … with 1 more variable: recommended <lgl>
and cast it to a tidyverse tibble
:
library(tibble)
as_tibble(fit)
#> # A tibble: 6 x 8
#> dose tox n empiric_tox_rate mean_prob_tox median_prob_tox admissible
#> <ord> <dbl> <dbl> <dbl> <dbl> <dbl> <lgl>
#> 1 NoDo… 0 0 0 0 0 TRUE
#> 2 1 0 2 0 0.02 0.01 TRUE
#> 3 2 1 4 0.25 0.26 0.21 TRUE
#> 4 3 1 2 0.5 0.5 0.5 TRUE
#> 5 4 0 0 NaN NA NA TRUE
#> 6 5 0 0 NaN NA NA TRUE
#> # … with 1 more variable: recommended <lgl>