Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › End-to-End Simulation of a Multi-Arm Multi-Stage Design

Simulation and Software · Tutorial 462 of 499

End-to-End Simulation of a Multi-Arm Multi-Stage Design

Learn how to specify, run, check, and summarize an end-to-end simulation of a shared-control MAMS design.

Intermediate 13 min read

What You'll Learn

  • Specify a hypothetical two-stage MAMS design and its outcome-generation assumptions
  • Implement interim futility selection and independent final-stage tests
  • Calculate final test statistics and apply exact critical-value rules
  • Record decisions and operating characteristics consistently by replicate
  • Quantify Monte Carlo uncertainty in estimated error rates and power
  • Diagnose failures that can invalidate an otherwise plausible simulation

From a Design Specification to Replicate-Level Results

A MAMS simulation is useful only if the whole sequence of decisions is represented in the right order. Generating plausible outcomes is not enough: the simulation must apply the interim rule, carry forward only eligible arms, test them as specified, and record the resulting decisions. Repeating that complete process gives estimates of operating characteristics such as family-wise error and power.

This tutorial works through a hypothetical design with two experimental arms and a shared control. It is deliberately specific: a clear design makes it possible to identify exactly which data are used at each stage and why the resulting tests have their stated error properties. The same workflow can be adapted to other prespecified designs, but changing a rule or reusing data can change the operating characteristics.

Design specification: There are two experimental arms, A and B, and one shared control. Outcomes are continuous, larger values are better, and individual outcomes are independent normal random variables with known variance \(1\). At stage 1, 40 participants are assigned to each arm. An arm continues if its stage-1 standardized treatment-versus-control statistic is at least \(0\); otherwise it stops for futility. At stage 2, 60 new participants are assigned to the shared control and to each arm that continues. Final tests use stage-2 data only. Each retained arm is declared successful when its one-sided p-value is at most \(0.0125\), equivalently when its statistic is at least the exact standard normal quantile \(z_{0.9875}\).

The stage-1 rule is a screening rule, not an efficacy test: no arm can be declared successful at the interim. The final comparisons use only new stage-2 observations, so their test statistics are independent of the stage-1 selection decisions under the model. The control group is shared within each stage, meaning that comparisons with A and B are not independent of each other. The per-arm final threshold is Bonferroni's allocation of a family-wise level \(0.025\) across two possible comparisons.

Model, Statistics, and Error Control

Write \(\mu_0,\mu_A,\mu_B\) for the mean outcomes in control, A, and B, respectively. In a scenario, the simulation specifies these means. Each participant's outcome in group \(g\) follows \(N(\mu_g,1)\), and outcomes are independent across participants. Assignment counts are fixed as stated above; there are no missing outcomes, dropouts, or changes to the allocation in this worked design. These are assumptions of the example, not universal properties of MAMS trials.

For arm \(j\in\{A,B\}\), let \(\bar{x}_{j,1}\) and \(\bar{x}_{0,1}\) be the stage-1 sample means. Since each stage-1 group has 40 participants and the variance is known to be 1, the standard error of the difference is \(\sqrt{1/40+1/40}\). The interim statistic and continuation indicator are therefore

$$ Z_{j,1}=\frac{\bar{x}_{j,1}-\bar{x}_{0,1}}{\sqrt{1/40+1/40}}, \qquad R_j=I(Z_{j,1}\geq 0). $$

Here \(I(\cdot)\) is 1 when its condition is true and 0 otherwise. At stage 2, the comparison uses new data, with 60 participants in each contributing group:

$$ Z_{j,2}=\frac{\bar{x}_{j,2}-\bar{x}_{0,2}}{\sqrt{1/60+1/60}}, \qquad j\in\{A,B\}. $$

A retained arm succeeds if \(Z_{j,2}\geq z_{0.9875}\), or equivalently if its one-sided p-value is at most \(0.0125\). The exact quantile defines the boundary; its approximate numerical value is about 2.241. An arm that stops at stage 1 is not tested at stage 2 and cannot be successful in that replicate.

The final tests are valid after selection because the stage-2 observations are independent of all stage-1 outcomes under the model. Conditional on an arm being retained, its stage-2 test still has its null distribution when \(\mu_j=\mu_0\). Thus its conditional probability of rejection under that null is \(0.0125\). For the two comparisons, the probability of at least one false rejection is at most the sum of the two marginal probabilities, hence at most \(2(0.0125)=0.025\). This Bonferroni bound does not require the two statistics to be independent; the shared stage-2 control generally makes them correlated.

A Complete Replicate: Generate, Select, Test, Record

The simulation unit is one complete trial replicate. Within a replicate, generate all stage-1 observations, apply the continuation rule, generate stage-2 observations for the retained arms and their shared control, perform the final tests, and save the decisions. It is important to generate stage-2 data only for retained arms, while generating a single stage-2 control group if at least one arm continues.

Worked Example: Applying Both Stages to One Hypothetical Replicate

Suppose one simulated replicate has stage-1 sample means \(\bar{x}_{0,1}=0.05\), \(\bar{x}_{A,1}=0.30\), and \(\bar{x}_{B,1}=0.10\). These are hypothetical generated means, not observations from a real trial. The common stage-1 standard error is

$$ SE_1=\sqrt{1/40+1/40}=\sqrt{0.05}=0.2236. $$

For A, \(Z_{A,1}=(0.30-0.05)/0.2236=1.118\), so A continues. For B, \(Z_{B,1}=(0.10-0.05)/0.2236=0.2236\), so B also continues because its statistic is at least 0. Neither result is an efficacy conclusion; both arms merely pass the futility screen.

Suppose the stage-2 means are \(\bar{x}_{0,2}=0.00\), \(\bar{x}_{A,2}=0.55\), and \(\bar{x}_{B,2}=0.20\). The standard error is

$$ SE_2=\sqrt{1/60+1/60}=\sqrt{1/30}=0.1826. $$

Then \(Z_{A,2}=(0.55-0.00)/0.1826=3.012\), which exceeds the exact \(z_{0.9875}\) threshold, so A succeeds. For B, \(Z_{B,2}=(0.20-0.00)/0.1826=1.095\), which is below the threshold, so B does not succeed. The replicate record is: A retained and successful; B retained and not successful; no stage-1 futility stops.

A useful record has one row per replicate and fields that distinguish selection from rejection. For example, save both continuation indicators, both final success indicators, the number of arms retained, and whether any final rejection occurred. A final success indicator must be zero for an arm not retained; otherwise summaries can accidentally count an unavailable test as a negative or positive result inconsistently.

1
Set the scenario and design.
Specify the means, variance, sample sizes, allocation, interim rule, final threshold, and number of replicates before generating outcomes.
2
Generate stage 1 and select arms.
Generate independent outcomes for the three groups, calculate both interim statistics using the shared control, and apply the continuation rule exactly.
3
Generate stage 2 and test.
If one or more arms continue, generate one shared control group and new outcomes for each retained arm. Calculate the stage-2 statistics and apply the prespecified final rule.
4
Save one complete record.
Store selection and success separately, along with any counts or diagnostics needed to verify the replicate.
5
Summarize across replicates.
Estimate each operating characteristic from its replicate-level indicator and report Monte Carlo uncertainty as well as the point estimate.

From Replicates to Operating Characteristics

For a specified scenario, the estimated power for arm A is the fraction of replicates in which A is declared successful. This definition incorporates both its chance of passing interim selection and its chance of passing the final test. Under the global null, the estimated family-wise error rate is the fraction of replicates with at least one false final success. If only one arm is null, its false-positive rate is calculated from that arm's success indicator. These quantities have different denominators and meanings; the scenario's true means must be recorded alongside the summaries.

Worked Example: Estimating Power and Family-Wise Error

Suppose 10,000 hypothetical replicates are run under a scenario with \(\mu_0=0\), \(\mu_A=0.30\), and \(\mu_B=0\). In this scenario A has a positive treatment effect and B is null. Assume 2,108 replicates declare A successful, 61 declare B successful, and 118 have at least one success among the two arms. The estimated power for A is

$$ \widehat{\text{Power}}_A=\frac{2108}{10000}=0.2108. $$

The estimated false-positive probability for B in this scenario is \(61/10000=0.006100\). The probability of any success is not the false-positive rate here, because it includes true successes for A. To estimate family-wise error under the global null, a separate scenario with \(\mu_A=\mu_B=\mu_0\) is required, and the replicate indicator is “at least one arm declared successful.”

For a binomial replicate indicator with estimated proportion \(\hat{p}=0.0118\) from 118 events in 10,000 global-null replicates, the estimated Monte Carlo standard error is

$$ SE_{\mathrm{MC}}=\sqrt{\frac{\hat{p}(1-\hat{p})}{R}} =\sqrt{\frac{0.0118(1-0.0118)}{10000}} =0.001080. $$

A rough 95% Monte Carlo interval is \(0.0118\pm1.96(0.001080)\), or approximately \([0.00968,0.01392]\). This interval describes simulation uncertainty in estimating the operating characteristic, not uncertainty about the treatment effect. A Wilson interval is often preferable when an event probability is near 0 or 1; the essential point is to report finite-replicate uncertainty rather than treating the simulated estimate as exact.

Why the Workflow Matters: Assumptions and Failure Modes

The order of operations is part of the statistical design. In this example, using stage-1 data again in the final test would make the final statistic dependent on selection and invalidate the simple conditional error argument above. A design that reuses interim data can be simulated, but its testing rule and error control must explicitly account for that reuse; it is not a harmless coding variation.

Likewise, a simulation must represent the shared control correctly. Generating a separate control group for each comparison would remove the correlation induced by the common control and could distort the distribution of “at least one success.” Conversely, using one control group but treating the two final tests as independent when summarizing family-wise error would ignore their dependence. Bonferroni's bound remains valid without independence.

Check at least the following before interpreting results:

  • Design consistency: verify group sizes, stage timing, allocation, and whether stage-2 control is generated once or more than once.
  • Decision consistency: confirm the interim boundary includes equality as specified, and that the final rule uses \(Z\geq z_{0.9875}\) or \(p\leq0.0125\). At the exact boundary, these two rules agree.
  • Record consistency: ensure no arm can be marked successful if it was not retained, and ensure “any success” is computed from the arm-level indicators.
  • Scenario consistency: verify that null scenarios truly set the relevant treatment and control means equal, and that power scenarios use the intended effects.
  • Numerical checks: flag missing values, non-finite statistics, or unexpected sample counts rather than silently treating them as non-rejections.

The common shortcut “generate a large matrix of outcomes, then test whatever arms look promising” is not itself a design specification. It can work computationally only if the stored data and indices preserve the required stage boundaries, shared-control structure, and eligibility rules. Modular code for generation, decision logic, and summaries makes these checks easier; the earlier material on simulation verification and coding errors gives complementary tools for testing those components.

ApproachWhat it doesImportant distinction
End-to-end simulationRepeats the full trial process under specified scenariosCaptures the operating characteristics of the implemented design, subject to model and coding assumptions
Analytic calculationDerives operating characteristics from probability distributionsCan be faster or exact in tractable cases, but may be difficult for complicated adaptation rules
Partial simulationSimulates only a stage or a final testCan answer targeted questions, but does not estimate whole-design behavior unless the omitted components are handled correctly

Simulation does not repair a poorly specified design, guarantee control under unexamined distributions, or remove Monte Carlo error. Results apply to the scenarios and assumptions actually represented. In particular, the normal model with known variance here is a transparent teaching example; other outcome types, nuisance-parameter estimation, missingness, or data reuse require their own generation and analysis rules.

Key takeaway: An end-to-end MAMS simulation is a repeated implementation of the design's complete decision path. Make the data-generating model, stage-specific data, selection rules, final tests, replicate records, and uncertainty summaries explicit—and verify that they match one another.

Check Your Understanding

Answer each question, then compare with the brief solutions below.

  1. Why does the worked design use only stage-2 data for final testing?
  2. If an arm has \(Z_{j,1}=0\), is it retained under the specified interim rule?
  3. What event should be counted to estimate family-wise error under the global null?
  4. For 5,000 replicates and an estimated event proportion of 0.04, calculate the Monte Carlo standard error.
  5. Why is it incorrect to simulate an independent control group for each experimental comparison in this design?

Solutions. (1) Stage-2 data are independent of stage-1 selection under the stated model, so the final test retains its null distribution conditional on selection. Reusing stage-1 data would require an analysis that accounts for that dependence. (2) Yes. The rule is \(Z_{j,1}\geq0\), so equality qualifies. (3) Count replicates with at least one false final rejection; under the global null, any success is false. Divide that count by the total number of valid replicates. (4) \(SE_{\mathrm{MC}}=\sqrt{0.04(0.96)/5000}=\sqrt{0.00000768}=0.002771\). (5) The design has one shared control group, which induces dependence between treatment-control comparisons. Separate controls simulate a different design and can change the distribution of the number of rejections.

Clinical Biostats