The essential insight of package precautionary is distilled into the safety tabulation which it generates from trial simulations, reporting the expected number of patients who will experience each grade of toxicity. To render this table for easy interpretation, these expectations are simply displayed with a number of significant digits appropriate to their Monte Carlo standard errors (MCSEs).

# S3 method for safetytab
format(x, ...)

Arguments

x

A safety tabulation as found in the safety component of the list returned by summary.precautionary.

...

Unused; included for compatibility with generic signature

Note

The MCSEs of safety tabulations remain available for inspection (see example), but are omitted from standard displays because they may lend themselves to misinterpretation as confidence bounds on the number of patients who will experience each toxicity grade in any given trial.

Examples

mtdi_gen <- hyper_mtdi_lognormal(CV = 1
                                ,median_mtd = 5
                                ,median_sdlog = 0.5
                                ,units="mg/kg")
ordinalizer <- function(MTDi, r0 = 1.5)
  MTDi * r0 ^ c(Gr1=-2, Gr2=-1, Gr3=0, Gr4=1, Gr5=2)
old <- options(dose_levels = c(0.5, 1, 2, 4, 6)
              ,ordinalizer = ordinalizer)
get_boin(num_doses = 5, target = 0.25) %>%
  stop_at_n(n = 24) %>%
  simulate_trials(
    num_sims = 60
  , true_prob_tox = mtdi_gen) -> boin_hsims
safety <- summary(boin_hsims)$safety
safety # The print method invokes 'format.safetytab' ..
#>   None  Gr1  Gr2  Gr3  Gr4  Gr5  Total
#>     13    4    3    2    1    1   24.0
# .. but we can also inspect the underlying matrix by indexing:
safety[,]  # indexing strips 'safetytab' class, returning plain matrix
#>                             None       Gr1       Gr2       Gr3       Gr4
#> Expected participants 12.8833333 3.7166667 3.1333333 2.0166667 1.2833333
#> MCSE                   0.4830995 0.2401643 0.2346613 0.1688975 0.1367328
#>                             Gr5 Total
#> Expected participants 0.9666667    24
#> MCSE                  0.1364743     0
# Note that, by extend()ing the simulation we can increase precision:
if (interactive()) { # may run a bit too long for CRAN servers' taste
  boin_hsims %>% extend(target_mcse = 0.1) -> boin_hsimsX
  summary(boin_hsimsX)$safety
}
options(old)