simcrm: Simulate CRM design

View source: R/simulate.R

simcrmR Documentation

Simulate CRM design

Description

Simulate a CRM dose-escalation study.

Usage

simcrm(probs, expansion = 0L, target = 1/6, nptmax = length(probs) * 6L, ...)

Arguments

probs

vector of true rates of DLTs

expansion

(optional) integer giving size of expansion cohort

target

target AE rate

nptmax

max number of patients used on study (not including the expansion cohort)

...

additional arguments passed to simCrm

Value

A list with following components:

$data

UBCRM::simCrm()$data

$level

mtd level (i.e., row of data selected)

$mtd

DLT rate of dose level selected

$expansion

observed rate of DLT in expansion cohort

$cohort

observed rate of DLT in all patients

$enrolled

total number of patients enrolled on study

See Also

sim3p3

Examples

pr <- 1:5 / 10
simcrm(pr)


## run 100 crm studies
sim1 <- replicate(100L, simcrm(pr), simplify = FALSE)

op <- par(mfrow = c(1, 2), las = 1L)
out <- sapply(sim1, function(x) c(x$level, x$enrolled))
barplot(
  prop.table(table(out[1, ])),
  main = 'Dose selected',
  xlab = 'RP2D',
  ylab = 'Proportion selected'
)
boxplot(
  split(out[2, ], out[1, ]),
  ylim = c(0, length(pr) * 6 + 10),
  main = 'N used to select dose x',
  xlab = 'Dose selected\n(0 - no safe dose)',
  ylab = 'Total size'
)
par(op)


raredd/desmon2 documentation built on Feb. 9, 2023, 12:09 p.m.