precautionary (version 0.1-2)

format.safetytab: Format a phase 1 trial safety tabulation to show significant digits only

Description

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

Usage

# 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

Examples

Run this code
# NOT RUN {
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 = 80
  , true_prob_tox = mtdi_gen) -> boin_hsims
safety <- summary(boin_hsims)$safety
safety # The print method invokes 'format.safetytab' ..
# .. but we can also inspect the underlying matrix by indexing:
safety[,]  # indexing strips 'safetytab' class, returning plain matrix
# 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)
# }

Run the code above in your browser using DataLab