sim3p3 | R Documentation |
Simulate a standard 3+3 dose (de-)escalation study.
sim3p3(probs, expansion = 10, escalation = TRUE, n.max = Inf)
probs |
vector of true rates of DLTs |
expansion |
(optional) integer giving size of expansion cohort |
escalation |
logical; if |
n.max |
maximum number of patients available for dose-finding and expansion cohorts combined |
A list with the following components:
$data |
dose by patient matrix: 0 - no DLT, 1 - DLT |
$summary |
total number of DTLs, patients, and probability of DLT per dose level for escalation and total |
$level |
mtd level (i.e., row of |
$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 |
simcrm
## standard 3+3 with 10 patient expansion cohort
pr <- 1:5 / 10
sim3p3(pr)
## run 1000 3+3 studies
sim1 <- replicate(1000L, sim3p3(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)
## 3+3 de-escalation, starting at highest dose
## run 1000 3+3 studies
pr2 <- rev(pr)
sim2 <- replicate(1000L, sim3p3(pr2, escalation = FALSE), simplify = FALSE)
op <- par(mfrow = c(1, 2), las = 1L)
out <- sapply(sim2, 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.