Why Simulate a Rule-Based Design?
The 3+3 design is a deterministic decision rule applied to outcomes that are random. Its operating characteristics are therefore probabilities over all possible trial paths: for example, the probability of selecting each dose, selecting a dose whose true toxicity rate is above a chosen target, or stopping without a recommendation. Simulation estimates these probabilities by repeatedly generating hypothetical trials under a specified set of dose-specific dose-limiting toxicity (DLT) probabilities.
The simulation does not predict what will happen in a particular real trial. It answers a conditional question: if the assumed DLT probabilities and model assumptions were true, how often would this protocol produce each outcome? The results depend on the scenario supplied, the exact protocol rules coded, and the number of simulated trials.
Define the Algorithm and the Scenario
This tutorial uses the conventional rule with complete DLT ascertainment before each decision, no unevaluable participants, and no dose skipping. The underlying participant outcomes are independent Bernoulli variables at each dose, with DLT probability \(p_j\); outcomes are identically distributed for participants treated at the same dose. The scenario probabilities are treated as fixed and known for the purpose of evaluating the design. A monotone scenario, \(p_1 \leq p_2 \leq \cdots \leq p_K\), is natural for ordered doses, although the algorithm can be run for nonmonotone probabilities too. In a nonmonotone scenario, dose-based interpretations such as “highest acceptable dose” require particular care.
For interpretation, define the true target dose \(j^*\) as the highest dose with \(p_j \leq p_T\), when at least one dose meets that condition. A selected dose above \(j^*\) is an overdose selection; one below \(j^*\) is an underdose selection. Selecting no dose is reported separately, not counted as either kind of selection. If no dose meets the target criterion, or if every dose meets it, describe that scenario explicitly rather than forcing an ambiguous underdose or overdose label.
Calculate a Branch Probability Before Simulating
A short calculation checks the logic of the first decision. At dose 1, the chance of 0 DLTs among three participants is \((1-p_1)^3\). The chance of exactly 1 DLT is \(3p_1(1-p_1)^2\). After exactly 1/3, escalation occurs only if the next three have 0 DLTs, with probability \((1-p_1)^3\), under the independence assumption. Thus, the probability of escalating after evaluating dose 1 is
The first term is the 0/3 path; the second is the 1/3 path followed by 0/3 in the added cohort. All other paths stop at dose 1. This identity is also a useful check on a simulation: escalation and stopping probabilities at the first dose must sum to 1.
Worked Example: Checking the First-Dose Branches
Suppose the hypothetical DLT probability at dose 1 is \(p_1=0.10\). The probability of 0/3 is \(0.9^3=0.729\), and the probability of exactly 1/3 is \(3(0.10)(0.9)^2=0.243\). Given 1/3, the probability that the additional cohort has 0/3 is again \(0.9^3=0.729\). Therefore,
The probability of stopping at dose 1 is the complement, \(1-0.906147=0.093853\), approximately 0.0939. It can also be checked by adding the paths: at least 2/3 initially has probability \(3(0.10)^2(0.90)+(0.10)^3=0.028\); exactly 1/3 followed by at least 1/3 in the added cohort has probability \((0.243)(1-0.729)=0.065853\). Their sum is \(0.028+0.065853=0.093853\). These are complementary outcomes under the stated rule.
A Reproducible Simulation Procedure
One simulated trial is generated by applying the protocol to newly generated participant outcomes. At any dose with 1/3 DLTs, the next cohort is generated at the same dose, not at the next dose. At a dose with 0/3, no additional cohort is enrolled there. Each simulated trial ends with a selected dose (possibly none), a dose at which toxicity stopped escalation or the trial reached its maximum dose, and a path of enrolled cohorts.
Write down \(K\), the vector \((p_1,\ldots,p_K)\), the target \(p_T\), the rule set, and the number \(N\) of simulated trials.
At the current dose, generate three independent Bernoulli DLT outcomes. Apply the 0/3, 1/3, and at-least-2/3 rules. If necessary, generate the additional cohort of three at the same dose.
Record the recommended dose or “none,” the dose where escalation stopped, and any other prespecified quantities such as total enrollment.
Repeat independently \(N\) times. Divide the number of trials with each outcome by \(N\) to estimate its probability.
The following base R code gives an executable implementation. The output value 0 denotes no selected dose; positive values denote the selected dose index. The recorded stopping dose is the dose where a toxicity boundary was met, or the highest dose if the trial reached the top under the rule.
set.seed(552); sim1 <- function(p) { K <- length(p); selected <- 0L; stopdose <- K; for (j in seq_len(K)) { x <- rbinom(1, 3, p[j]); if (x == 0) { if (j == K) { selected <- j; break } } else if (x == 1) { y <- rbinom(1, 3, p[j]); if (x + y <= 1) { if (j == K) { selected <- j; break } } else { selected <- j - 1L; stopdose <- j; break } } else { selected <- j - 1L; stopdose <- j; break } }; c(selected = selected, stopdose = stopdose) }; p <- c(0.10, 0.25, 0.40); N <- 10000L; z <- t(replicate(N, sim1(p))); table(factor(z[, "selected"], levels = 0:3))
The seed makes the random-number stream reproducible within the same R environment and generator settings; it does not make the simulation estimates exact probabilities. To estimate stopping at each dose, tabulate the recorded `stopdose` values as well. In a different programming language, the same algorithm and a documented seed should be used. Check that probabilities supplied to the code lie between 0 and 1, that the vector length matches the intended dose grid, and that each cohort follows the protocol.
Worked Example: Turning Simulated Counts Into Operating Characteristics
Consider a hypothetical three-dose scenario with \(p=(0.10,0.25,0.40)\) and target \(p_T=0.25\). The target dose is dose 2: it meets the target, and dose 3 exceeds it. Suppose a run of 10,000 simulated trials gives 1,610 selections of dose 1, 6,850 of dose 2, 1,090 of dose 3, and 450 trials with no dose selected. These illustrative counts sum to \(1,610+6,850+1,090+450=10,000\).
The estimated selection probabilities are the respective counts divided by 10,000: 0.161 for dose 1, 0.685 for dose 2, 0.109 for dose 3, and 0.0450 for no dose. Dose 3 is the only overdose selection in this scenario, so the estimated overdose-selection probability is \(1,090/10,000=0.109\). Selection below the target dose means selecting dose 1, giving an estimated underdose-selection probability of \(1,610/10,000=0.161\). No dose is selected in 0.0450 of simulated trials; it is reported separately.
These are hypothetical simulation results, not results from a clinical study. They describe the frequencies in this run; another run can differ because of Monte Carlo variation. The frequency of stopping for toxicity at a particular dose is calculated from the separately recorded stopping-dose counts, not inferred from the dose-selection counts alone.
Monte Carlo Error and Basic Diagnostics
For a prespecified event, such as selecting an overdose, each simulated trial either has the event or does not. Under independent simulation runs, the event indicator is Bernoulli with probability \(\theta\). If \(\hat{\theta}\) is the proportion of \(N\) runs with the event, its estimated Monte Carlo standard error is
This formula follows because the sample mean of \(N\) independent Bernoulli indicators has variance \(\theta(1-\theta)/N\); replacing the unknown \(\theta\) by \(\hat{\theta}\) estimates that variance. It measures simulation noise, not uncertainty in the true \(p_j\) values and not sampling uncertainty in a future clinical trial outcome.
Worked Example: Assessing Monte Carlo Precision
Using the illustrative overdose estimate \(\hat{\theta}=0.109\) from 10,000 runs, the estimated Monte Carlo standard error is
A rough 95% Monte Carlo margin is \(1.96(0.00312)=0.00612\), so simulation noise alone is on the order of six-tenths of a percentage point on either side of 10.9%. This is an approximate precision summary, not a confidence interval for an unknown clinical parameter. More runs reduce Monte Carlo error at approximately the rate \(1/\sqrt{N}\); quadrupling \(N\) roughly halves it.
Useful diagnostics include verifying that all selection frequencies, including “none,” sum to 1; checking the first-dose branch calculation against a direct simulation; and examining whether escalation, additional cohorts, and stopping occur exactly as the written rule specifies. For \(N\) independent trials, the standard error for a very rare event may still be substantial relative to its estimated probability. If an event is never observed, the estimate is zero, not proof that its probability is zero. Increase \(N\), or use exact path enumeration for a small dose grid when exact calculation is practical.
Interpretation, Alternatives, and Limitations
Simulation and exact enumeration are complementary ways to calculate operating characteristics. Exact enumeration lists all possible outcome paths and sums their probabilities; it can avoid Monte Carlo error and is valuable for checking a small design. The number of paths can grow quickly as doses and cohorts increase, and coding every branch can itself be error-prone. Simulation is often simpler to extend and makes it straightforward to record quantities such as enrollment and stopping dose, but its estimates have Monte Carlo error. Neither method repairs a misspecified scenario or an incorrectly implemented protocol.
The simulation conditions on the chosen \(p_j\) values. It does not establish that those values are clinically plausible, account for uncertainty about them, or estimate toxicity from actual trial data. The simple Bernoulli model also omits delayed DLT ascertainment, dependence among participants, changing eligibility or follow-up, and other features unless they are explicitly incorporated. Results are specific to the exact escalation and selection conventions coded. For example, changing how the highest dose is handled changes the operating characteristics.
A common mistake is to report the proportion of trials that stopped at the top dose as the probability of selecting the top dose. These are not necessarily the same event: a trial can reach the top dose and then stop for toxicity, recommending the dose below. Correction: record “selected dose” and “stopping dose” separately, and define every reported event before running the simulation. Similarly, do not call every trial ending without reaching the top a “no-dose” outcome; the design may have selected a lower dose after a toxicity boundary.
Check Your Understanding
Answer each question, then compare your reasoning with the brief solutions below.
- At a dose with \(p_j=0.20\), what is the probability of 0 DLTs in the first cohort of three under the stated model?
- In the conventional rule, what happens after 1/3 DLTs followed by 1/3 in the additional cohort?
- In a scenario with target dose \(j^*=3\), how should selection of dose 2 and no dose be classified?
- If an event occurs in 250 of 10,000 simulations, calculate its estimated probability and approximate Monte Carlo standard error.
Solutions. (1) The probability is \((1-0.20)^3=0.8^3=0.512\). (2) The combined result is 2/6, so escalation stops for toxicity and the dose below is recommended, if one exists; at the lowest dose, no dose is selected. (3) Dose 2 is an underdose selection because it is below \(j^*=3\); no dose is a separate outcome. (4) The estimate is \(250/10,000=0.0250\), and its estimated standard error is \(\sqrt{0.025(0.975)/10,000}\approx0.00156\).