simulate_boinet: Simulate operating characteristics using BOINET

View source: R/simulate_boinet.R

simulate_boinetR Documentation

Simulate operating characteristics using BOINET

Description

This function runs simulations of the BOINET design by evaluating operating characteristics over a range of cohort sizes. For each dose level within the user-specified range, it performs multiple trials and saves the results to a corresponding file.

Usage

simulate_boinet(
  ndose,
  ssizerange,
  target_t,
  lower_e,
  cohortsize = 3,
  startdose = 1,
  psafe = 0.95,
  pfutility = 0.9,
  ntrial = 10000,
  utilitytype = 1,
  prob = NULL,
  save_dir = tempdir(),
  save_folder = "boinet_simulations",
  save_file = "boinet_simulation.csv"
)

Arguments

ndose

Integer. Number of dose levels. (Required)

ssizerange

Integer vector. Range of number of cohorts to simulate. (Required)

target_t

Numeric. Target toxicity probability. (Required)

lower_e

Numeric. Minimum acceptable efficacy probability. (Required)

cohortsize

Integer. Size of a cohort. (Default is 3)

startdose

Integer. Starting dose level. (Default is 1)

psafe

Numeric. Early stopping cutoff for toxicity. (Default is 0.95)

pfutility

Numeric. Early stopping cutoff for efficacy. (Default is 0.90)

ntrial

Integer. Number of random trial replications. (Default is 10000)

utilitytype

Integer. Type of utility structure. (Default is 1)

  • If set to 1: Use preset weights (w11 = 0.6, w00 = 0.4)

  • If set to 2: Use (w11 = 1, w00 = 0)

prob

Fixed probability vectors. If not specified, a random scenario is used by default. Use this parameter to provide fixed probability vectors as a list of the following named elements:

  • pE: Numeric vector of efficacy probabilities for each dose level.

  • pT: Numeric vector of toxicity probabilities for each dose level.

  • obd: Integer indicating the index of the true Optimal Biological Dose (OBD).

  • mtd: Integer indicating the index of the true Maximum Tolerated Dose (MTD).

For example:

prob <- list(
  pE = c(0.4, 0.5, 0.6, 0.6, 0.6),
  pT = c(0.1, 0.2, 0.3, 0.4, 0.4),
  obd = 3,
  mtd = 2
)
save_dir

Directory to save output folders. Default is tempdir().

save_folder

Folder name. (Default is "boin12_simulations")

save_file

File name. (Default is "boin12_simulation.csv")

Value

No return value, called for side effects

Examples

prob <- list(
  pE = c(0.4, 0.5, 0.6, 0.6, 0.6),
  pT = c(0.1, 0.2, 0.3, 0.4, 0.4),
  obd = 3,
  mtd = 2
)
simulate_boinet(
  ndose = 5,
  ssizerange = 1:2,
  target_t = 0.3,
  lower_e = 0.4,
  ntrial = 10,
  prob = prob,
)

phase12designs documentation built on Sept. 2, 2025, 9:09 a.m.