simulations: Simulated trials.

View source: R/simulations.R

simulationsR Documentation

Simulated trials.

Description

This class encapsulates that many notional or virtual trials can be simulated. Each recommends a dose (or doses), keeps track of how many patients have been treated at what doses, what toxicity outcomes have been seen, and whether a trial advocates continuing, etc. We run simulations to learn about the operating characteristics of a trial design.

Computationally, the simulations class supports much of the same interface as selector, and a little more. Thus, many of the same generic functions are supported - see Examples. However, compared to selectors, the returned objects reflect that there are many trials instead of one, e.g. num_patients(sims), returns as an integer vector the number of patients used in the simulated trials.

Usage

simulations(fits, true_prob_tox, true_prob_eff = NULL, ...)

Arguments

fits

Simulated model fits, arranged as list of lists.

true_prob_tox

vector of true toxicity probabilities

true_prob_eff

vector of true efficacy probabilities, optionally NULL if efficacy not analysed.

...

Extra args

Details

The simulations object implements the following functions:

  • num_patients

  • num_doses

  • dose_indices

  • n_at_dose

  • tox_at_dose

  • num_tox

  • recommended_dose

  • prob_administer

  • prob_recommend

  • trial_duration

Value

list with slots: fits containing model fits; and true_prob_tox, contianing the assumed true probability of toxicity.

See Also

selector

simulate_trials

Examples


# Simulate performance of the 3+3 design:
true_prob_tox <- c(0.12, 0.27, 0.44, 0.53, 0.57)
sims <- get_three_plus_three(num_doses = 5) %>%
  simulate_trials(num_sims = 10, true_prob_tox = true_prob_tox)
# The returned object has type 'simulations'. The supported interface is:
sims %>% num_patients()
sims %>% num_doses()
sims %>% dose_indices()
sims %>% n_at_dose()
sims %>% tox_at_dose()
sims %>% num_tox()
sims %>% recommended_dose()
sims %>% prob_administer()
sims %>% prob_recommend()
sims %>% trial_duration()

# Access the list of model fits for the ith simulated trial using:
i <- 1
sims$fits[[i]]
# and the jth model fit for the ith simulated trial using:
j <- 1
sims$fits[[i]][[j]]
# and so on.

escalation documentation built on June 27, 2024, 5:09 p.m.