Tutorials › Adaptive Clinical Trial Design › Simulating Type I Error for a Seamless Design

Seamless Phase 2/3 Designs · Tutorial 501 of 799

Simulating Type I Error for a Seamless Design

Build a simulation that follows the trial’s actual decision path and estimates how often it makes a false confirmatory claim under the null.

Advanced 12 min read

What You'll Learn

  • Define the null rejection event for a seamless design.
  • Specify a simulation that reproduces allocation, arm selection, testing, and stopping.
  • Estimate the null rejection rate and its Monte Carlo standard error.
  • Interpret a simulated rate in light of the design’s significance level.
  • Identify implementation errors that can make the estimate misleading.

Why Simulate the Complete Decision Path?

In a seamless phase 2/3 trial, the confirmatory test is reached only if earlier decisions allow the trial to continue. Participants are randomized, phase 2 outcomes are observed, a treatment may be selected, and stopping rules determine whether phase 3 proceeds. The null rejection rate is the probability that this complete process ends in a false confirmatory rejection when the null hypothesis is true. It is therefore a property of the design’s full sequence of rules, not just of the final test considered in isolation.

Simulation estimates this probability by generating many hypothetical trials under a specified null model and applying the design exactly as written to each one. A simulation is useful only if it reproduces the design’s randomization, selection, stagewise testing, and stopping. For example, simulating the final test but ignoring the chance that phase 2 stops early does not estimate the operating characteristic of the actual design.

Definition: For a design that can make a confirmatory claim, its null rejection rate is \(P(\text{at least one confirmatory rejection}\mid H_0)\), under a stated null data-generating model and the design’s complete decision rules. In a design with only one possible claim, this is the probability that the design rejects that claim when its null hypothesis is true.

Specify the Design and Null Model First

Consider a hypothetical design with three candidate treatments, A, B, and C, and a control. The endpoint is a continuous outcome measured so that larger values are better. The example uses a simple model to make the simulation transparent; a real simulation should use the endpoint model and assumptions specified for its own design.

In phase 2, 120 participants are randomized in equal numbers to control, A, B, and C: 30 per group. Let \(\bar{x}_j\) denote the phase 2 sample mean for group \(j\). The design selects the treatment with the largest observed mean difference from control, provided that difference is at least 0.15 outcome units. Otherwise, the trial stops without a confirmatory claim. If a treatment is selected, phase 3 enrolls 100 new participants to that treatment and 100 new participants to control, with equal allocation.

After 50 phase 3 participants per group have outcomes, an interim futility rule stops the trial if the selected-treatment-versus-control \(Z\)-statistic is below 0. If the trial continues, the remaining participants are enrolled. At the end, the design rejects the selected treatment’s null hypothesis only if the one-sided final \(Z\)-statistic exceeds 1.96. The phase 2 data select the treatment but are not included in this confirmatory test.

For this example, assume each outcome is independent and normally distributed with variance 1, and under the global null all four group means are 0. The phase 2 and phase 3 participants are distinct. Randomization fixes the stated group sizes; phase 3 allocation is randomized equally between the selected treatment and control. Outcomes are complete, and the variance used in the test is known to be 1. These assumptions make the test statistic’s null distribution explicit. They are assumptions of this hypothetical model, not facts about a real clinical trial.

The null hypothesis for simulation is the global null: none of A, B, or C differs from control. Each simulated trial must still follow the same allocation and decision rules it would follow if the outcomes happened to favor a treatment. It would be incorrect to force the selected treatment to be a particular arm, or to bypass selection because the simulation is being run under the null.

Key definition: For replicate \(b\), define \(I_b=1\) if the simulated design makes a confirmatory rejection, and \(I_b=0\) otherwise. A trial that stops before making a claim has \(I_b=0\). With \(M\) independent simulated trials, the estimated null rejection rate is \(\hat{p}_{\text{null}}=\frac{1}{M}\sum_{b=1}^{M}I_b\).

Implement Each Replicate in Order

The simulation should follow the protocol’s temporal sequence. The flow below gives the steps for the hypothetical design; the group sizes and thresholds should be replaced by those of the design being assessed.

1
Randomize phase 2.
Allocate 30 participants to each of control, A, B, and C according to the design’s randomization procedure.
2
Generate phase 2 outcomes and apply selection.
Generate outcomes under the null model. Select the arm with the largest sample-mean difference from control only if that difference is at least 0.15; otherwise record a stop and no rejection.
3
Randomize phase 3 and apply futility.
If a treatment is selected, randomize new participants equally to that treatment and control. At 50 per group, calculate the interim statistic and stop if it is below 0.
4
Apply the final test and record the result.
If the trial continues to 100 per group, calculate the final statistic. Record a rejection only if it exceeds 1.96; otherwise record no rejection.

In phase 3, with \(n\) participants per group, the test statistic is the observed difference in means divided by its standard error. Under the stated model, each group mean has variance \(1/n\); the independent difference has variance \(1/n+1/n=2/n\). Thus \(SE=\sqrt{2/n}\). At the final analysis \(n=100\), and at the interim analysis \(n=50\). The one-sided threshold 1.96 corresponds approximately to a significance level \(\alpha=0.025\) for a standard normal statistic.

Worked Example: One Simulated Trial

Suppose one hypothetical phase 2 replicate produces means of 0.02 for control, 0.10 for A, 0.24 for B, and 0.16 for C. The observed differences from control are \(0.10-0.02=0.08\) for A, \(0.24-0.02=0.22\) for B, and \(0.16-0.02=0.14\) for C. B is the largest, and its difference exceeds the 0.15 threshold, so B is selected.

At the phase 3 interim, suppose the means among 50 participants per group are 0.12 for B and 0.02 for control. The standard error is \(\sqrt{2/50}=\sqrt{0.04}=0.20\). Therefore, \(Z_{\text{interim}}=(0.12-0.02)/0.20=0.50\). Because \(0.50\) is not below 0, the trial does not stop for futility.

Suppose the final means among 100 participants per group are 0.08 for B and 0.00 for control. The standard error is \(\sqrt{2/100}=\sqrt{0.02}\approx0.1414\), so \(Z_{\text{final}}=(0.08-0.00)/0.1414\approx0.566\). Since \(0.566\) does not exceed 1.96, this replicate makes no confirmatory rejection. Its indicator is \(I_b=0\), even though B passed the phase 2 selection threshold.

Estimate the Rate and Quantify Simulation Error

Across \(M\) simulated trials, each \(I_b\) is a Bernoulli random variable: it equals 1 with probability \(p_{\text{null}}\) and 0 otherwise. If the replicates are independently generated, their average estimates that probability. Its approximate Monte Carlo standard error is \(\sqrt{\hat{p}_{\text{null}}(1-\hat{p}_{\text{null}})/M}\). This standard error measures simulation noise, not uncertainty about the model assumptions or about how well the model represents a future trial.

Worked Example: Interpreting a Simulation Estimate

Suppose an illustrative run of \(M=100{,}000\) hypothetical trials produces 1,790 confirmatory rejections under the global null. Then \(\hat{p}_{\text{null}}=1{,}790/100{,}000=0.01790\), or 1.790%.

The estimated Monte Carlo standard error is \(\sqrt{0.01790(1-0.01790)/100{,}000}=\sqrt{0.0000001758}\approx0.000419\). An approximate 95% Monte Carlo interval is \(0.01790\pm1.96(0.000419)\), or about \([0.01708,0.01872]\). This interval describes simulation precision for the specified model and algorithm. It does not mean there is a 95% probability that the design’s true null rejection rate lies in this particular interval.

The estimated rate is below the nominal one-sided level of 0.025. In this example, that is consistent with a conservative design: the phase 2 stopping rule and phase 3 futility rule can prevent a rejection that might otherwise occur. The simulation estimate is not itself a proof of control at 0.025; its Monte Carlo uncertainty and the correctness of the implementation both matter.

Why the Final-Test Argument Is a Useful Check

A simple probability argument provides a check on the simulation. Let \(C\) denote the event that the design selects a treatment and continues far enough to make the final test. Let \(R\) denote final rejection. For this design, \(R\) requires the final statistic to exceed 1.96. Under the global null, conditional on phase 2 selection, the new phase 3 data have no treatment effect and are independent of phase 2. The selected arm is therefore fixed with respect to the phase 3 outcomes, and the final \(Z\)-statistic has a standard normal distribution under the stated model.

The interim futility rule can only remove possible rejections; it cannot create one. The rejection event is contained in the event that the final statistic exceeds 1.96. Therefore:

$$ P(R\mid H_0) \leq P(Z_{\text{final}}>1.96\mid H_0) \approx 0.025. $$

This is a justification for expecting a rate no greater than approximately 0.025 under the stated assumptions. It does not supply the exact rate, because phase 2 selection and the interim rule affect whether the final test is reached. The simulation estimates the rate for the complete set of rules. If the design instead used phase 2 outcomes in its confirmatory statistic, or allowed an early efficacy rejection, the argument above would not establish control; those rules would need to be included and justified in the evaluation.

Worked Example: Check the Monte Carlo Precision Needed

Suppose the target is a Monte Carlo standard error no larger than 0.0005, and the anticipated null rejection rate is about 0.02. Using the standard-error formula, choose \(M\) so that \(\sqrt{0.02(0.98)/M}\leq0.0005\). Squaring both sides gives \(M\geq0.02(0.98)/(0.0005)^2=78{,}400\). Thus about 80,000 replicates meet this approximate target if the anticipated rate is accurate.

The required number depends on the rate being estimated and the precision sought. If the observed rate differs substantially from the planning value, recalculate the Monte Carlo standard error using the observed \(\hat{p}_{\text{null}}\). Increasing \(M\) reduces simulation error; it does not repair an incorrect randomization scheme or a misspecified null model.

Diagnostics, Alternatives, and Limitations

Before trusting the estimate, verify that the implementation records the entire decision path. Useful checks include confirming that every replicate has the intended randomized group sizes, that selection follows the prespecified tie and threshold rules, that no phase 3 outcomes are generated or analyzed after a stop, and that stopped trials are counted as no rejection. Check a few replicates by hand, as in the worked example, and verify that the final statistic uses the intended sample size and standard error.

A common mistake is to simulate a fresh, fixed phase 3 comparison for a treatment chosen in advance, then treat its rejection rate as the seamless design’s null rejection rate. That omits randomized phase 2 selection and the stopping path. In this particular example, independent phase 3 data mean selection does not invalidate the phase 3-only test, but ignoring the probability of stopping still fails to reproduce the design’s overall rejection event. In a design that reuses phase 2 evidence, independence cannot be assumed and the simulated joint data and testing rule must reflect that reuse.

Simulation is flexible: it can follow a complicated sequence of allocation, selection, and stopping rules that may be awkward to analyze in closed form. A direct probability argument, as above, is a valuable independent check when its assumptions apply. For simpler designs, exact calculations or analytical calibration may give a more precise answer without Monte Carlo error. Simulation does not automatically establish validity: its estimate applies to the specified model and the implemented rules. It can also be imprecise when \(M\) is too small, and errors in code can make a precise estimate wrong.

The global-null simulation answers a specific question: how often does the design reject when all candidate treatments have no effect? It does not by itself establish error control for every configuration in which some treatments work and others do not. Nor does it establish that the assumed outcome model is appropriate. The estimated rate should be reported together with the null model, the decision rules, the number of replicates, and the Monte Carlo standard error so that its scope is clear.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. If a simulated trial stops at the phase 2 selection step, what value should its rejection indicator have?
  2. In one replicate, the final treatment-control difference is 0.30 with 100 participants per group. Calculate the final statistic and state whether the design rejects.
  3. A simulation has \(M=50{,}000\) replicates and 1,000 rejections. Calculate the estimated null rejection rate and approximate Monte Carlo standard error.
  4. Why must phase 2 selection be reproduced even when phase 2 outcomes are not used in the final confirmatory statistic?

Solutions. (1) Set \(I_b=0\): the design made no confirmatory rejection. (2) The standard error is \(\sqrt{2/100}\approx0.1414\), so \(Z=0.30/0.1414\approx2.121\). This exceeds 1.96, so the final rule rejects, provided the trial reached the final analysis. (3) The estimate is \(1{,}000/50{,}000=0.0200\). Its Monte Carlo standard error is \(\sqrt{0.0200(0.9800)/50{,}000}\approx0.000626\). (4) Selection determines whether the trial proceeds and which treatment enters phase 3. Omitting it changes the probability of reaching the confirmatory test and therefore does not simulate the complete design.

Clinical Biostats