Learn R Programming

FIND (version 0.1.1)

run_simulation: Run Simulations for Phase I Dose-Finding Designs

Description

Generic function to conduct computer simulations for phase I dose-finding designs.

Usage

run_simulation(design, p.true, mtd.true, ...)

# S3 method for boin_design run_simulation(design, p.true, mtd.true, ...)

# S3 method for i3plus3_design run_simulation(design, p.true, mtd.true, ...)

# S3 method for mtpi2_design run_simulation(design, p.true, mtd.true, ...)

# S3 method for g3plus3_design run_simulation(design, p.true, mtd.true, ...)

# S3 method for threethree_design run_simulation(design, p.true, mtd.true, ...)

# S3 method for default run_simulation(design, p.true, mtd.true, ...)

Value

A list containing 'selection' (a dataframe showing selection percentages and metrics POS, PCS, PUS), 'allocation' (a dataframe showing participant allocation across dose levels), and 'setup' (a list containing design parameters and simulation settings).

Arguments

design

A design object created by one of the design constructor functions (design_boin, design_i3plus3, design_mtpi2, design_g3plus3, or design_3plus3).

p.true

A vector or matrix containing the true toxicity probabilities of the investigational dose levels.

mtd.true

A numeric value or vector specifying the true MTD.

...

Additional arguments passed to methods.

Examples

Run this code
# Create design specifications
boin <- design_boin(pT = 0.25, EI = c(0.15, 0.35), ncohort = 10)
i3 <- design_i3plus3(pT = 0.25, EI = c(0.2, 0.3), ncohort = 10)

# Define toxicity scenarios
p.true <- matrix(c(0.05, 0.10, 0.20, 0.30, 0.45,
                   0.10, 0.15, 0.25, 0.35, 0.50),
                 nrow = 2, byrow = TRUE)
# Binary matrix indicating true MTD for each scenario (dose 3 for both)
mtd.true <- matrix(c(0, 0, 1, 0, 0,
                     0, 0, 1, 0, 0),
                   nrow = 2, byrow = TRUE)

# Run simulations
# \donttest{
sim_boin <- run_simulation(boin, p.true = p.true, mtd.true = mtd.true)
sim_i3 <- run_simulation(i3, p.true = p.true, mtd.true = mtd.true)
# }

Run the code above in your browser using DataLab