Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › Implementing Scenario-Based Enrollment Calculations

Sample Size and Expected Sample Size · Tutorial 234 of 499

Implementing Scenario-Based Enrollment Calculations

Learn to organize scenario-based enrollment calculations so each stage size, decision-path probability, maximum, and expected enrollment can be traced and checked.

Advanced 10 min read

What You'll Learn

  • Distinguish new stage accrual from cumulative enrollment and define the maximum consistently.
  • Represent scenario-specific stopping paths with mutually exclusive probabilities.
  • Calculate expected enrollment from path probabilities and enrollment at each path.
  • Organize inputs, intermediate results, and outputs in an auditable structure.
  • Check probability totals, stage reach, and enrollment bounds before reporting results.
  • Choose between exact enumeration and simulation as sources of decision probabilities.

From a Design Calculation to an Auditable Workflow

A sample-size calculation becomes operational only when its assumptions can be followed through to the reported enrollment. In a multi-arm multi-stage (MAMS) design, enrollment depends not just on the planned number at each stage, but also on which stages are reached under each scenario. A software workflow should therefore preserve the link between stage sizes, scenario-specific decision probabilities, and the enrollment associated with each decision path.

The goal here is not to rederive the probabilities of stopping or continuing. Those probabilities may come from exact enumeration or simulation under a specified scenario. The implementation task is to record them in a consistent form and calculate the maximum and expected enrollment without losing the assumptions or intermediate quantities needed to audit the result.

Define the Quantities Before Coding

Definition: Let \(s\) index a planning scenario, \(k=1,\ldots,K\) index stages, \(a\) index treatment arms (including control), and \(r\) index mutually exclusive decision paths. Let \(n_{a,k}\) be the number of newly enrolled participants assigned to arm \(a\) at stage \(k\). The maximum enrollment \(N_{\max}\) is the total enrollment if all planned stages and accruals occur. For scenario \(s\), let \(p_{s,r}\) be the probability of path \(r\), and \(N_{s,r}\) the total enrollment on that path. The expected enrollment under scenario \(s\) is \(E_s[N]=\sum_r p_{s,r}N_{s,r}\).

The stage-size convention matters. Here, \(n_{a,k}\) means new participants at stage \(k\), not the cumulative number enrolled in arm \(a\) by that stage. If all arms are planned to recruit at all stages, the maximum is

$$ N_{\max}=\sum_{k=1}^{K}\sum_a n_{a,k}. $$

If a design allows an arm to stop while other arms continue, the enrollment on a path must reflect that path's actual accrual. One general representation uses \(I_{s,r,a,k}=1\) when arm \(a\) accrues at stage \(k\) on path \(r\), and \(0\) otherwise:

$$ N_{s,r}=\sum_{k=1}^{K}\sum_a n_{a,k}I_{s,r,a,k}. $$

The path probabilities must describe an exhaustive set of mutually exclusive outcomes under scenario \(s\). Thus, \(p_{s,r}\geq 0\) for every path and \(\sum_r p_{s,r}=1\). If an algorithm reports conditional probabilities at successive stages, they must be converted into probabilities of the complete paths, or used directly to calculate stage-reach probabilities. The two representations should not be mixed.

A Reproducible Calculation Sequence

A useful implementation separates the design specification, the probability calculation, and the enrollment summary. This makes it possible to identify which part of the calculation produced a reported value.

1
Store the design inputs.
Record the number of stages, arm labels, newly enrolled participants per arm and stage, allocation rules, and any prespecified accrual changes. Store the assumptions defining each scenario separately from the stage-size table.
2
Generate decision-path probabilities.
For each scenario, obtain probabilities for the complete, mutually exclusive paths from the chosen probability calculation. Retain the method and relevant settings, such as the enumeration specification or simulation replicate count.
3
Map paths to actual enrollment.
For each path, identify which stage accruals occur and sum the corresponding participant counts. Count shared-control participants once per stage, not once for every comparison using that control.
4
Summarize and check.
Calculate \(N_{\max}\) and \(E_s[N]\) for every scenario. Check that path probabilities sum to one within numerical tolerance and that each path enrollment is between zero and the maximum.
5
Save structured results.
Preserve the input assumptions, probabilities, path-level enrollment, and scenario-level summaries together, with units and enough information to reproduce the calculation.

Worked Calculations

Worked Example: One Scenario With Two Possible Stopping Paths

Hypothetical design. There are three arms: one control and two experimental arms. At stage 1, 20 participants are enrolled in each arm. If the design continues, stage 2 adds 20 participants in each arm. Suppose a probability calculation under one hypothetical scenario gives probability 0.25 of stopping after stage 1 and probability 0.75 of reaching the end of stage 2.

The stage-1 accrual is \(20+20+20=60\) participants. Stage 2 adds another \(60\), so maximum enrollment is \(60+60=120\) participants. The stopping paths and their enrollment are:

PathProbabilityEnrollment
Stop after stage 10.2560 participants
Continue through stage 20.75120 participants

The path probabilities sum to \(0.25+0.75=1.00\), as required. Expected enrollment is

$$ E_s[N]=(0.25)(60)+(0.75)(120)=15+90=105\text{ participants}. $$

Thus, under this hypothetical scenario, the design's expected enrollment is 105 participants, while its maximum is 120. The expected value is a probability-weighted average across possible paths; it does not mean that a particular trial enrolls a fractional number of participants.

Worked Example: Keep Scenario-Specific Results Separate

Use the same hypothetical two-stage design, with 60 participants accrued at stage 1 and 60 added at stage 2. Suppose the probability of stopping after stage 1 is 0.60 under scenario A and 0.20 under scenario B. In each scenario, the remaining probability corresponds to reaching stage 2.

For scenario A, the probability of reaching stage 2 is \(1-0.60=0.40\). Therefore,

$$ E_A[N]=(0.60)(60)+(0.40)(120)=36+48=84\text{ participants}. $$

For scenario B, the probability of reaching stage 2 is \(1-0.20=0.80\). Therefore,

$$ E_B[N]=(0.20)(60)+(0.80)(120)=12+96=108\text{ participants}. $$

The maximum is 120 participants in both scenarios, but the expected enrollment differs because the path probabilities differ. The workflow should report 84 and 108 as separate scenario-specific results rather than silently averaging them. If a decision maker has prespecified scenario weights of 0.70 for A and 0.30 for B, the weighted summary is

$$ (0.70)(84)+(0.30)(108)=58.8+32.4=91.2\text{ participants}. $$

That final value answers a different question: it is an average under the stated scenario weights, not the expected enrollment under either scenario alone.

Worked Example: Convert Conditional Decisions to Stage-Reach Probabilities

Consider a hypothetical three-stage design with 60 participants newly enrolled at each stage, counting all arms together. Suppose the probability of stopping after stage 1 is 0.20. Conditional on reaching stage 2, suppose the probability of stopping there is 0.375. If neither stop occurs, the design reaches stage 3.

The unconditional probability of stopping after stage 2 is the probability of reaching stage 2 multiplied by the conditional probability of stopping there:

$$ P(\text{stop after stage 2})=(1-0.20)(0.375)=0.80(0.375)=0.30. $$

The probability of reaching stage 3 is \(0.80(1-0.375)=0.50\). The complete-path probabilities are therefore 0.20, 0.30, and 0.50, which sum to 1.00. Enrollment on the three paths is 60, 120, and 180 participants, respectively. Hence,

$$ E_s[N]=(0.20)(60)+(0.30)(120)+(0.50)(180)=12+36+90=138\text{ participants}. $$

This calculation illustrates why an output field must say whether a probability is conditional on reaching a stage or is an unconditional probability of a complete path. Treating 0.375 as the unconditional probability of stopping after stage 2 would not represent the stated decision process.

Why the Stage-Reach Formulation Works

Expected enrollment can also be calculated from the probability of reaching each stage. Let \(d_k=\sum_a n_{a,k}\) be the total new accrual planned at stage \(k\), and let \(R_k\) be the indicator that stage \(k\) is reached. Total enrollment is the sum of the stage accruals that actually occur:

$$ N=\sum_{k=1}^{K}d_kR_k. $$

Taking expectations and using linearity of expectation gives

$$ E_s[N]=\sum_{k=1}^{K}d_kE_s[R_k] =\sum_{k=1}^{K}d_kP_s(\text{reach stage }k). $$

This does not require the stage-reach indicators to be independent. Since \(R_k\) equals 1 when stage \(k\) is reached and 0 otherwise, its expectation is its probability of being 1. In the three-stage example, this gives \(60(1)+60(0.80)+60(0.50)=60+48+30=138\) participants, the same result as the path calculation. Path sums are especially transparent when arm-specific accrual varies by path; stage-reach sums are compact when each reached stage has a fixed total accrual.

Output Design, Checks, and Alternatives

A structured result should let a reviewer move from a scenario summary down to the paths and inputs that produced it. A practical set of fields is shown below.

Output levelFields to retainPurpose
DesignScenario identifier; stage number; arm; newly enrolled count; unitsDefines accrual and allows the maximum to be reconstructed
Probability calculationScenario identifier; path identifier; path description; probability; calculation methodConnects probabilities to the scenario and method that produced them
Path enrollmentScenario identifier; path identifier; stages reached; enrollment by arm; total enrollmentShows exactly how each path contributes to expected enrollment
SummaryScenario identifier; maximum enrollment; expected enrollment; probability-sum checkProvides a concise result while preserving an audit trail

At minimum, check that stage accruals are nonnegative integers when participants are counted individually; that stage labels are in the intended order; that the full-stage enrollment agrees with the calculated maximum; and that each path's enrollment follows the accrual rules. Check also that path probabilities are nonnegative and sum to one within a tolerance appropriate to the numerical method. For every scenario, \(0\leq E_s[N]\leq N_{\max}\) should hold when the maximum is the largest possible enrollment under that design.

Exact enumeration and simulation are alternative sources of the probabilities, not alternative definitions of expected enrollment. Enumeration can give exact probabilities for a finite set of outcomes when the outcome distribution and decision rules are tractable. Simulation can accommodate more complicated calculations, but its reported probabilities are estimates and should retain the simulation settings needed to assess their numerical precision. In either case, once the path probabilities and path enrollments are available, the same weighted-sum calculation applies.

A common implementation mistake is to add cumulative sample sizes across stages as though they were new accruals. For example, if a report says cumulative enrollment is 60 at stage 1 and 120 at stage 2, calculating the maximum as \(60+120=180\) double-counts stage-1 participants. The correction is to use either new accruals, \(60+60=120\), or the final cumulative total, 120, but never to add cumulative totals together.

Another important boundary is the meaning of enrollment. The formulas above count participants enrolled. If the design also tracks participants with usable outcomes after attrition, retain that as a distinct quantity with its own assumptions; do not substitute an evaluable-sample count for enrollment without explicitly changing the target. Structured outputs improve traceability, but they cannot compensate for an underspecified scenario, incorrect decision probabilities, or an accrual rule that does not match the design.

Check Your Understanding

Use the definitions and workflow above to answer the questions. Solutions follow.

  1. A design accrues 45 participants at stage 1 and 45 more at stage 2. The probability of stopping after stage 1 is 0.30. What are the maximum and expected enrollment?
  2. Under a scenario, a three-path output has probabilities 0.15, 0.25, and 0.55. What should be checked before using these values to calculate expected enrollment?
  3. Stage 2 has a conditional stop probability of 0.40, given that the design reached stage 2. The probability of reaching stage 2 is 0.75. What is the unconditional probability of stopping after stage 2?
  4. Why should scenario-specific expected enrollments usually be retained separately even when a single overall average is requested?

Solutions. (1) Maximum enrollment is \(45+45=90\) participants. The probability of reaching stage 2 is \(1-0.30=0.70\), so expected enrollment is \((0.30)(45)+(0.70)(90)=13.5+63=76.5\) participants. (2) Check nonnegativity and completeness: the probabilities sum to \(0.15+0.25+0.55=0.95\), not 1.00, so the path set or probabilities must be resolved before calculation. (3) The unconditional probability is \(0.75(0.40)=0.30\). (4) Each scenario has its own assumptions and decision probabilities; a single average requires explicit scenario weights and answers a different question from any one scenario-specific expectation.

Clinical Biostats