Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › Generating Binary Outcomes With Shared Controls

Simulation and Software · Tutorial 429 of 499

Generating Binary Outcomes With Shared Controls

Learn to simulate participant-level binary outcomes for treatment arms and a shared control while preserving planned allocation and stage labels.

Intermediate 10 min read

What You'll Learn

  • Define a Bernoulli outcome model for each trial arm and stage.
  • Generate binary responses from event probabilities using uniform random numbers.
  • Represent a shared control group once, with outcomes used in all relevant comparisons.
  • Decide when participant-level Bernoulli simulation or aggregate binomial simulation is appropriate.
  • Check allocation, denominators, event rates, and simulation assumptions.
  • Preserve stage and arm labels without replacing the trial’s data-generation structure.

Why the Outcome-Generation Step Matters

A simulation of a multi-arm, multi-stage trial must generate data that could plausibly have arisen under the scenario being studied. For a binary endpoint, each participant contributes an event or a non-event. The simulation therefore needs an event probability for each arm, the correct number of participants assigned to each arm, and a single record of each participant’s outcome. These details matter: if the simulated allocation differs from the protocol, or if a separate control sample is generated for every treatment comparison, the simulated data no longer represent the intended trial.

The outcome probabilities are inputs to a simulation scenario. For example, a scenario might specify a control event probability of 0.20 and treatment-arm probabilities of 0.35 and 0.10. A simulated dataset will not generally have observed proportions exactly equal to those inputs; random variation is part of the simulation.

Binary Outcome Model

Let \(j=0\) denote the shared control arm and \(j=1,\ldots,J\) denote the experimental arms. Let \(k\) index stages and \(i\) index participants within an arm and stage. Define \(Y_{ijk}=1\) if participant \(i\) in arm \(j\) at stage \(k\) experiences the event, and \(Y_{ijk}=0\) otherwise. Let \(p_{jk}\) be the event probability specified for that arm and stage.

Definition: Under the basic binary-outcome simulation model, each participant’s response is a Bernoulli random variable: $$ Y_{ijk}\sim\operatorname{Bernoulli}(p_{jk}),\qquad P(Y_{ijk}=1)=p_{jk},\qquad P(Y_{ijk}=0)=1-p_{jk}. $$ The model requires \(0\le p_{jk}\le 1\). Conditional on their assigned arms and the scenario parameters, participant outcomes are generated independently unless the simulation explicitly specifies another outcome model. If the scenario assumes no stage variation, set \(p_{jk}=p_j\) for every stage.

The independence assumption is a simplifying data-generating assumption, not a property guaranteed by binary measurement. It is appropriate when each participant’s response is modeled as an independent Bernoulli outcome conditional on the assigned arm and scenario. If the planned trial has clustering, repeated measurements, or specified covariate-dependent event rates, those features require a corresponding model rather than independent draws from one fixed probability per arm.

For a control probability \(p_0\) and a treatment effect expressed as an absolute risk difference \(\delta_j\), a scenario can set \(p_j=p_0+\delta_j\). This parameterization is valid only when the resulting probability is in the interval from zero to one. Another direct approach is to specify each \(p_j\) separately. In either case, the scenario probabilities are not estimates calculated from the simulated outcomes.

Generating Each Response

A simple way to generate a Bernoulli response is to draw \(U\) from a uniform distribution on the interval from zero to one, then set the response to one when \(U<p_{jk}\) and to zero otherwise. The justification follows directly from the uniform distribution:

$$ P(Y_{ijk}=1)=P(U<p_{jk})=p_{jk},\qquad P(Y_{ijk}=0)=1-p_{jk}. $$

Thus the threshold rule has exactly the required event probability. Repeating it independently for each participant produces the specified Bernoulli outcomes. When only the event count in an arm-stage cell is needed, the sum of \(n_{jk}\) independent responses has a binomial distribution:

$$ X_{jk}=\sum_{i=1}^{n_{jk}}Y_{ijk} \sim\operatorname{Binomial}(n_{jk},p_{jk}). $$

The mean count is \(n_{jk}p_{jk}\), but this is an expectation, not a count that must occur in any one simulated dataset. Participant-level responses are preferable when the analysis needs individual records, stage labels, covariates, or participant-level eligibility information. A binomial draw is a valid shortcut when the analysis uses only the event count and denominator for each arm-stage cell.

Worked Example: Turning Uniform Draws Into Binary Responses

Consider a hypothetical single-stage trial with a shared control and two treatment arms. Suppose the specified event probabilities are \(p_0=0.20\), \(p_1=0.35\), and \(p_2=0.10\), with five participants per arm. To illustrate the threshold rule, suppose the random-number generator returns the following uniform draws.

For control, the draws are 0.07, 0.23, 0.81, 0.18, and 0.44. Comparing each draw with 0.20 gives responses \(1,0,0,1,0\), so the control event count is \(2\) and its observed event proportion is \(2/5=0.400\).

For treatment 1, the draws are 0.11, 0.42, 0.31, 0.88, and 0.05. Comparing with 0.35 gives \(1,0,1,0,1\), for an event count of \(3\) and an observed proportion of \(3/5=0.600\).

For treatment 2, the draws are 0.06, 0.13, 0.02, 0.77, and 0.39. Comparing with 0.10 gives \(1,0,1,0,0\), for an event count of \(2\) and an observed proportion of \(2/5=0.400\).

The simulated proportions need not equal their generating probabilities. For example, treatment 1 has a simulated proportion of 0.600 even though its specified event probability is 0.35. The three arm-specific comparisons use the same five control outcomes; the control participants are not regenerated separately for each treatment.

Preserving the Allocation and Shared Control

The allocation is part of the data-generating specification. First determine the planned number of participants in each arm and stage, following the trial’s allocation scheme. Then generate the outcomes for exactly those participants using the probability for their assigned arm and stage. If assignment is randomized according to a specified mechanism, use that mechanism to create assignments; do not replace it with equal arm sizes unless equal allocation is actually planned.

A shared control means that control participants form one control group for the relevant treatment comparisons. Each control participant has one assigned arm and one generated outcome. That same record can be used when the analysis compares control with multiple experimental arms. It is not appropriate to generate a fresh control group for each contrast: doing so changes the trial allocation and simulates a different design.

Worked Example: One Shared Control Under Unequal Allocation

Suppose a hypothetical trial plans 12 control participants and 6 participants in each of two treatment arms. Its scenario specifies \(p_0=0.25\), \(p_1=0.40\), and \(p_2=0.15\). The planned allocation is therefore control:treatment 1:treatment 2 \(=12:6:6\), or \(2:1:1\). Generate 12 control outcomes, 6 treatment 1 outcomes, and 6 treatment 2 outcomes, each with its arm’s event probability.

For an aggregate-count simulation, the corresponding distributions are \(X_0\sim\operatorname{Binomial}(12,0.25)\), \(X_1\sim\operatorname{Binomial}(6,0.40)\), and \(X_2\sim\operatorname{Binomial}(6,0.15)\). Their expected event counts are \(12(0.25)=3.00\), \(6(0.40)=2.40\), and \(6(0.15)=0.900\), respectively.

Suppose one hypothetical simulation draw returns event counts \(X_0=4\), \(X_1=2\), and \(X_2=1\). The observed proportions are \(4/12=0.333\) in control, \(2/6=0.333\) in treatment 1, and \(1/6=0.167\) in treatment 2. Each count is within its possible range, and each denominator matches the planned allocation. The 12 control outcomes are generated once and contribute to both treatment-versus-control comparisons.

If individual outcomes are needed, store 24 participant records, each with an arm label and a binary response. Generating the three binomial counts instead is sufficient only if no later part of the analysis needs to distinguish individual participants.

Carrying Stage Information Through the Simulation

When the trial has multiple stages, the simulation should retain the stage label for every generated participant and use the probability specified for that participant’s arm and stage. If the scenario assumes stable event probabilities, a participant in a later stage uses the same \(p_j\) as a participant in an earlier stage. If the scenario specifies a change over time, use the corresponding \(p_{jk}\). Stage-specific allocation counts should also follow the planned design.

Retaining arm and stage labels makes it possible for the trial analysis to use the intended data organization. The generation step should not silently pool stage counts, alter denominators, or apply a treatment probability to control participants. The example below illustrates the bookkeeping with hypothetical uniform draws; it does not imply that an observed stage count must resemble its expected count.

Worked Example: Generating Outcomes Across Two Stages

Suppose a hypothetical two-stage trial enrolls two participants per arm in each stage. There is one shared control and two treatment arms, with stable event probabilities \(p_0=0.20\), \(p_1=0.35\), and \(p_2=0.10\). For each stage, generate two control outcomes and two outcomes in each treatment arm.

At stage 1, suppose the control uniforms are 0.11 and 0.61, giving \(1,0\) and an event count of \(1/2\). Treatment 1 uniforms are 0.28 and 0.47, giving \(1,0\) and \(1/2\). Treatment 2 uniforms are 0.04 and 0.32, giving \(1,0\) and \(1/2\).

At stage 2, suppose control uniforms are 0.72 and 0.16, giving \(0,1\) and \(1/2\). Treatment 1 uniforms are 0.80 and 0.09, giving \(0,1\) and \(1/2\). Treatment 2 uniforms are 0.08 and 0.55, giving \(1,0\) and \(1/2\).

Across both stages, the control group has \(2\) events among \(4\) participants, treatment 1 has \(2\) among \(4\), and treatment 2 has \(2\) among \(4\). Each participant still has one stage label and one outcome; the four control outcomes constitute the shared control data. Stage-specific counts remain recoverable because the records retain their stage labels.

Checks, Alternatives, and Limitations

After generation, check the simulated dataset against both the scenario and the protocol. Useful checks include:

  • Every response is either 0 or 1, and every specified probability is between zero and one.
  • The number of records in each arm and stage agrees with the planned allocation.
  • Every participant has one arm assignment, one outcome, and the correct stage label.
  • Control participants are recorded once, even when their outcomes enter several treatment comparisons.
  • Across many independent simulation replicates, the average event proportion in a cell is close to its specified probability.

The last check is a calibration check over repeated simulations, not a requirement for an individual replicate. For a cell with \(n\) participants and probability \(p\), the simulated event count has mean \(np\) and variance \(np(1-p)\). Some variation around \(np\) is expected; a single proportion that differs from \(p\) does not by itself indicate a coding error.

There are three common approaches to generating these data. Participant-level Bernoulli draws preserve full records and are the most flexible. Aggregate binomial draws are simpler and equivalent for event counts when the model has a common probability within each arm-stage cell and the analysis needs only counts and denominators. Deterministic assignment of a fixed number of events, such as rounding \(np\), is not a substitute for either approach: it suppresses outcome variation and does not simulate Bernoulli sampling.

A frequent mistake is to interpret “shared control” as permission to generate a separate control sample for every treatment comparison. That creates multiple control groups and changes the allocation. The correction is to generate the planned control participants once, then retain and reuse those same records in all applicable comparisons. Another mistake is to expect the simulated event count to equal \(np\); \(np\) is the expected count, not a guaranteed count.

The basic model also has limits. A single \(p_j\) per arm assumes a common event probability within that arm and stage; it does not represent participant heterogeneity unless that is added to the scenario. Independent Bernoulli draws do not capture clustering or other dependence between participants. If such features are part of the intended trial model, the generator must explicitly include them. The focus here is the foundational construction of binary outcomes with the protocol’s allocation and one shared control group.

Check Your Understanding

Answer each question, then compare your reasoning with the brief solution provided.

  1. A cell has \(n=20\) participants and event probability \(p=0.30\). What is the expected event count, and does a simulated count of 9 imply an error?

    Solution: The expected count is \(np=20(0.30)=6\). A count of 9 does not by itself imply an error; the binomial count varies around its expectation.

  2. A trial has one control arm and three treatment arms. Should a separate control sample be generated for each treatment-versus-control comparison?

    Solution: No. Generate the planned control participants once and retain their outcomes. Those same control records are used in each applicable comparison.

  3. A treatment probability is specified as \(p_1=0.18\), with a risk difference \(\delta_1=0.25\) added to form \(p_1=p_0+\delta_1\). What must be checked before using this parameterization?

    Solution: The resulting probability must be between zero and one. Here the stated treatment probability of 0.18 is valid, but the scenario values used to construct it must be consistent with \(p_0+\delta_1=0.18\); for example, \(p_0\) would need to be \(-0.07\), which is invalid. The proposed inputs therefore cannot define a valid risk-difference scenario as stated.

  4. When is a binomial draw an appropriate alternative to generating individual binary responses?

    Solution: It is appropriate when outcomes within an arm-stage cell have the same specified probability, the model treats them as independent Bernoulli outcomes, and the analysis requires only the event count and denominator. Use individual records if participant-level information is needed.

  5. A dataset has the correct total sample size but more control records than the protocol planned and fewer treatment records. Is the simulation structure correct?

    Solution: No. Matching the total sample size is not enough. The arm-specific allocation counts must also match the protocol’s allocation mechanism and planned numbers.

Clinical Biostats