Parse a string of dose-finding trial outcomes to the binary vector notation required by Stan for model invocation. The outcome string describes the doses given and outcomes observed. The format of the string is the pure phase I analogue to that described in Brock et al. (2017). The letters T and N are used to represents patients that experienced (T)oxicity and (N)o toxicity. These letters are concatenated after numerical dose-levels to convey the outcomes of cohorts of patients. For instance, 2NNT represents a cohort of three patients that were treated at dose-level 2, one of whom experienced toxicity, and two that did not. The results of cohorts are separated by spaces. Thus, 2NNT 1NN extends our previous example, where the next cohort of two were treated at dose-level 1 and neither experienced toxicity. See examples.

df_parse_outcomes(outcome_string, as.list = TRUE)

Arguments

outcome_string

character string, conveying doses given and outcomes observed.

as.list

TRUE (the default) to return a list; FALSE to return a data.frame

Value

If as.list == TRUE, a list with elements tox, doses and num_patients. These elements are congruent with those of the same name in crm_params, for example. If as.list == FALSE, a data.frame with columns tox and doses.

References

Brock, K., Billingham, L., Copland, M., Siddique, S., Sirovica, M., & Yap, C. (2017). Implementing the EffTox dose-finding design in the Matchpoint trial. BMC Medical Research Methodology, 17(1), 112. https://doi.org/10.1186/s12874-017-0381-x

Examples

x = df_parse_outcomes('1NNN 2NTN 3TTT') x$num_patients # 9
#> [1] 9
x$doses # c(1, 1, 1, 2, 2, 2, 3, 3, 3)
#> [1] 1 1 1 2 2 2 3 3 3
x$tox # c(0, 0, 0, 0, 1, 0, 1, 1, 1)
#> [1] 0 0 0 0 1 0 1 1 1
sum(x$tox) # 4
#> [1] 4