Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › Benchmarking Against Analytic Special Cases

Simulation and Software · Tutorial 451 of 499

Benchmarking Against Analytic Special Cases

Use simple designs with known operating characteristics to check whether a MAMS simulation produces plausible results.

Intermediate 11 min read

What You'll Learn

  • Derive one-stage normal-test power and type I error for a single treatment comparison.
  • Benchmark familywise error in a no-selection configuration with independent comparisons.
  • Verify fixed-design expected sample size against its exact value.
  • Compare simulation estimates with analytic targets using Monte Carlo standard errors.
  • Diagnose mismatches caused by assumptions, dependence, or incorrect outcome definitions.

Why Benchmark a Simulation?

A simulation can run without errors and still return the wrong operating characteristics. A decision boundary may be applied at the wrong stage, a standard error may use the wrong sample size, or a reported error rate may count the wrong rejection event. Benchmarking checks the output against a case whose answer is known independently of the simulation code.

The useful question is not whether a simulated estimate equals its analytic target exactly. With a finite number of replicates, random variation is expected. Instead, check that the target follows from the same design and assumptions, then judge the discrepancy in relation to its Monte Carlo standard error. A simple case that fails this check gives a concrete reason to investigate before interpreting more complicated MAMS results.

Definition: An analytic benchmark is a known operating characteristic, such as a rejection probability or expected sample size, calculated from the design’s probability model without using the simulation being checked. A simulation benchmark compares the simulated estimate with this value under matching assumptions and decision rules.

A One-Stage, One-Comparison Benchmark

Begin with the simplest treatment comparison: one experimental arm, one control arm, and one final analysis. Assume \(n\) independent outcomes are observed in each arm, with normally distributed outcomes and a common known variance \(\sigma^2\). Let \(\delta\) be the difference in population means, experimental arm minus control. The estimated difference has sampling distribution

$$ \bar{x}_1-\bar{x}_0 \sim N\left(\delta,\frac{2\sigma^2}{n}\right), \qquad SE=\sqrt{\frac{2\sigma^2}{n}}. $$

For a one-sided test of \(H_0:\delta\leq 0\) against \(H_a:\delta>0\), reject when \(Z=(\bar{x}_1-\bar{x}_0)/SE>c\), where \(c\) is the critical value chosen for the test. Under the boundary null \(\delta=0\), \(Z\sim N(0,1)\), so the type I error is \(P(Z>c)=1-\Phi(c)\). Under a specified alternative \(\delta>0\), the standardized statistic has mean \(\delta/SE\) and variance 1. Its power is therefore

$$ P(Z>c\mid\delta) =1-\Phi\left(c-\frac{\delta}{SE}\right) =\Phi\left(\frac{\delta}{SE}-c\right). $$

This formula is a benchmark only when the simulated analysis uses the same endpoint model, known variance, allocation, sample size, test direction, and critical value. If the simulation estimates the variance and uses a \(t\)-test, or includes interim decisions, this particular normal calculation is not its exact target.

Worked Example: Checking Single-Comparison Power

Hypothetical design. Suppose each arm has \(n=50\) participants, outcomes have known standard deviation \(\sigma=10\) points, and the one-sided critical value is \(c=1.96\). Under a treatment effect of \(\delta=4\) points, calculate the analytic power and compare it with a hypothetical simulation of 100,000 trials.

The assumptions are independent normally distributed outcomes, equal allocation, and a known common standard deviation. The standard error is

$$ SE=\sqrt{\frac{2(10^2)}{50}}=\sqrt{4}=2\text{ points}. $$

The standardized effect is \(4/2=2\). Thus the analytic power is

$$ \Phi\left(\frac{4}{2}-1.96\right)=\Phi(0.04)\approx 0.5160. $$

Suppose the simulation rejects in 51,620 of 100,000 replicates. Its estimated power is \(51{,}620/100{,}000=0.5162\), with estimated Monte Carlo standard error

$$ SE_{\mathrm{MC}}= \sqrt{\frac{0.5162(1-0.5162)}{100{,}000}} \approx 0.001580. $$

The difference from the analytic target is \(0.5162-0.5160=0.0002\), about \(0.13\) Monte Carlo standard errors. This is a close match; the small difference is consistent with simulation variability, not evidence that the code must return the analytic value exactly.

Multiple Comparisons Without Arm Selection

A second benchmark removes interim selection while retaining more than one treatment comparison. “No selection” here means that all prespecified comparisons are carried through to the final analysis; it does not mean that multiplicity disappears. For a particularly transparent analytic check, suppose there are \(K\) independent one-sided tests under the global null and each uses significance level \(\alpha/K\). Independence is an explicit assumption for the calculation below. It can hold, for example, if comparisons use disjoint groups. It does not generally hold when treatment arms share a control group.

Let \(A_k\) be the event that comparison \(k\) rejects its null hypothesis. Under the global null, \(P(A_k)=\alpha/K\). Familywise error is the probability of at least one false rejection. For independent tests, the probability of no rejections is the product of the probabilities of no rejection in each test. Therefore,

$$ P\left(\bigcup_{k=1}^{K} A_k\right) =1-\prod_{k=1}^{K}P(A_k^c) =1-\left(1-\frac{\alpha}{K}\right)^K. $$

This is the exact familywise error for this independent-test configuration with Bonferroni-adjusted individual levels. It is generally below \(\alpha\), since Bonferroni controls familywise error at no more than \(\alpha\). For small \(\alpha\), the value is close to, but not exactly, \(\alpha\).

Worked Example: Benchmarking a No-Selection Configuration

Hypothetical design. Two experimental treatments are each compared with a separate, independent control group in a single final analysis. Both one-sided tests use the Bonferroni level \(\alpha/K=0.025/2=0.0125\). Under the global null, calculate the analytic familywise error and compare it with a hypothetical simulation of 100,000 trials.

The assumptions for this benchmark are that both individual tests have type I error 0.0125 and that their rejection events are independent. The probability of at least one false rejection is

$$ 1-(1-0.0125)^2 =1-(0.9875)^2 =1-0.97515625 =0.02484375. $$

Suppose the simulation records at least one rejection in 2,491 of 100,000 global-null trials. Its estimated familywise error is \(0.02491\). The Monte Carlo standard error is

$$ \sqrt{\frac{0.02491(1-0.02491)}{100{,}000}} \approx 0.000493. $$

The difference from the analytic value is \(0.02491-0.02484375=0.00006625\), about \(0.13\) Monte Carlo standard errors. The estimate is compatible with the benchmark. The analytic target is slightly below 0.025, as expected for this independent Bonferroni configuration.

The independence condition matters. In a usual multi-arm trial with a common control, comparisons are correlated because they use the same control observations. The product formula above is then not the exact familywise error. For a shared-control benchmark, derive or numerically evaluate the joint distribution of the test statistics under the specified model, including their correlation, and compare the simulation with that target. Do not label an independence-based calculation as exact for a shared-control design.

Benchmarking Expected Sample Size

Not every useful benchmark is a rejection probability. A fixed design with no early stopping or arm dropping has a deterministic total sample size, so its expected sample size is known exactly. This checks whether the simulation counts participants correctly and whether its output uses the intended unit: participants per arm, total participants, or participants accrued by a given stage.

Worked Example: Fixed Sample Size With No Selection

Hypothetical design. A trial has one control arm and two experimental arms. It enrolls 30 participants per arm in each of two stages. All arms continue to the final analysis, and there is no early stopping. The total planned sample size is

$$ N_{\mathrm{total}}=3(30+30)=180\text{ participants}. $$

Because every replicate follows the same accrual plan, the total sample size \(N\) equals 180 with probability 1. Consequently, \(E(N)=180\) participants and \(\operatorname{Var}(N)=0\). If a hypothetical run contains 1,000 replicates with aggregate accrued sample size 180,000, the simulated mean is \(180{,}000/1{,}000=180\) participants. Any nonzero variation in replicate totals, or a different mean, points to a mismatch in the accrual or counting logic rather than Monte Carlo error.

This deterministic check does not validate the trial’s outcome generation or test decisions. It isolates one component of the simulation so that a disagreement has a narrower set of possible causes.

How to Use a Benchmark as a Diagnostic

A useful benchmark is designed so that the simulated estimand and the analytic answer refer to the same event and the same design. Before comparing numbers, write down the assumptions and the exact event being counted. For example, “at least one rejection under the global null” is a familywise error event; “rejection for a particular experimental arm under its alternative” is that arm’s power. They are not interchangeable.

1
Reduce the design.
Choose a case with a known answer, such as one final normal comparison or a fixed no-stopping sample size.
2
Match the assumptions.
Align the outcome distribution, variance, allocation, dependence, test direction, multiplicity rule, and decision event.
3
Calculate independently.
Obtain the analytic probability or expectation without calling the simulation’s decision or reporting code.
4
Compare at the right precision.
For a simulated proportion \(\hat{p}\) based on \(R\) replicates, use \(SE_{\mathrm{MC}}=\sqrt{\hat{p}(1-\hat{p})/R}\) to describe its Monte Carlo uncertainty.
5
Investigate a substantive mismatch.
Check the simulated event definition, critical values, sample-size accounting, and model assumptions before treating the output as reliable.

The Monte Carlo standard error describes random error from using a finite number of replicates; it does not measure bias from incorrect code or a misspecified model. A discrepancy of several Monte Carlo standard errors is a reason to investigate, not a proof of a specific bug. Conversely, a close match in one special case does not establish that every part of a complex simulation is correct. It provides evidence about the components exercised by that benchmark.

Common Mistakes and Limitations

  • Using a benchmark with different assumptions. The known-variance normal formula is not the exact answer for a simulated \(t\)-test with estimated variance. Match the analysis procedure before comparing results.
  • Assuming shared-control tests are independent. Their statistics are correlated. The independent familywise-error product is not valid unless independence is justified.
  • Comparing unlike events. A per-comparison type I error is not the same as familywise error, and power under an alternative is not a null error rate.
  • Expecting exact equality from random replicates. A finite simulation varies. Quantify that variation with a Monte Carlo standard error and assess whether the observed difference is plausible.
  • Treating a passing benchmark as full validation. A one-stage case cannot exercise interim stopping, arm dropping, or other MAMS decision logic that is absent from that case.

Analytic formulas are often the clearest benchmark when they apply. For more complicated dependence structures, numerical integration or exact enumeration of a small discrete model can provide a separate reference. Simulation remains valuable where the design is too complex for a convenient analytic answer, but special cases test foundational pieces at low cost. Independent verification of simulation code complements benchmarking: the two approaches offer different checks, and neither makes the other unnecessary.

Key takeaway: A credible benchmark has a clearly stated analytic target, assumptions that match the simulated design, and a comparison that accounts for Monte Carlo uncertainty. Start with cases simple enough that disagreement can be traced to a specific modeling or implementation choice.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. With \(n=25\) per arm and known \(\sigma=8\), what is the standard error of the difference in sample means under the model used for the single-comparison benchmark?
  2. For three independent one-sided tests, each with type I error \(0.01\), what is the familywise error under the global null?
  3. Why is the independent-test familywise-error formula generally unsuitable for treatment comparisons that share a control group?
  4. A fixed design enrolls 20 participants in each of four arms at each of two stages, with no early stopping. What is its total sample size per replicate?

Solutions. (1) \(SE=\sqrt{2(8^2)/25}=\sqrt{5.12}\approx 2.263\) outcome units. (2) \(1-(1-0.01)^3=1-0.970299=0.029701\). (3) Sharing the control observations makes the comparison statistics dependent, so the probability of no rejections is not generally the product of the individual no-rejection probabilities. (4) There are four arms and 40 participants per arm across both stages, so the total is \(4(20+20)=160\) participants.

Clinical Biostats