Tutorials › Response-Adaptive Randomization › Design-Based Tests For Prespecified Subgroup Effects

Randomization-Based Inference · Tutorial 484 of 501

Design-Based Tests For Prespecified Subgroup Effects

Construct an exact subgroup randomization test by replaying the adaptive design, and identify what that test does—and does not—say about treatment-effect heterogeneity.

Advanced 10 min read

What You'll Learn

  • Define a sharp null for a subgroup fixed using baseline information.
  • Identify when subgroup-only outcomes suffice to replay an adaptive design.
  • Compute a conditional randomization p-value from complete assignment paths.
  • Use a subgroup-specific statistic without changing the randomization mechanism.
  • Distinguish a treatment effect within a subgroup from an interaction between subgroups.
  • Diagnose when conditioning, missing probabilities, or post hoc subgroup selection undermines a test.

Why subgroup tests need the assignment design

A treatment effect in a baseline-defined subgroup is a distinct question from whether the treatment effect differs between that subgroup and everyone else. For example, a trial may ask whether treatment has any effect among participants who met a specified baseline risk criterion. It may separately ask whether the effect among those participants differs from the effect among participants who did not meet the criterion. These questions have different null hypotheses.

With adaptive assignment, a subgroup test must also respect how treatment probabilities changed as the trial proceeded. Reassigning treatment labels while holding the observed assignment probabilities fixed generally does not reproduce the design: those probabilities may depend on earlier assignments and outcomes. The test developed here replays the assignment mechanism, while focusing its statistic on a subgroup selected using baseline information.

Definition: Let \(A_i\in\{0,1\}\) denote the treatment assigned to participant \(i\), and let \(Y_i(1)\) and \(Y_i(0)\) denote that participant’s potential outcomes under treatment and control. A subgroup \(S\) is baseline-defined if membership is determined from information recorded before treatment assignment. The sharp null of no treatment effect in \(S\) is $$ H_0^S: Y_i(1)=Y_i(0)\quad\text{for every }i\in S. $$ It makes no restriction on potential outcomes for participants outside \(S\).

The word sharp matters: under \(H_0^S\), each participant’s outcome in \(S\) is known under either treatment assignment. If the observed outcome is \(Y_i\), then the null implies \(Y_i(1)=Y_i(0)=Y_i\) for that participant. This lets us calculate the subgroup outcomes under every candidate assignment path. In contrast, a null that only says the average treatment effect in \(S\) is zero does not specify each participant’s missing potential outcome, so it does not by itself produce this randomization distribution.

Replay the mechanism, not just the labels

Write \(H_{i-1}\) for the information available to the randomization procedure before participant \(i\) is assigned. It can include earlier assignments, observed outcomes, baseline covariates, and the current state of the adaptive algorithm. The mechanism specifies \(\pi_i=P(A_i=1\mid H_{i-1})\), with probability \(1-\pi_i\) of control. In a replay, the probability at each step must be recalculated from the history generated by that candidate path.

A subgroup-specific statistic uses the participants in \(S\), but the assignment distribution is still generated by the full design. If assignment probabilities depend on outcomes from outside \(S\), the subgroup null alone does not reveal the counterfactual outside-subgroup outcomes needed to replay paths that change those participants’ assignments. One practical exact construction is therefore to condition on the observed assignments outside \(S\), when the conditional assignment distribution is well-defined and can be calculated. Their outcomes are then known under their fixed observed assignments. During each replay, use those fixed assignments and outcomes, but recompute each assignment probability according to the replayed history.

The conditioning is not permission to ignore the design. The probability of each candidate path must still include the probabilities of all assignments in the full mechanism, including fixed outside-subgroup assignments when their probabilities change with replayed history. If conditioning leaves no variation in assignments within \(S\), it supplies no informative test. Alternatively, an unconditional test can be exact under a sharp null for the whole trial, or when the remaining potential outcomes are otherwise specified, but those are stronger conditions than \(H_0^S\).

Definition: For a candidate full assignment path \(a=(a_1,\ldots,a_n)\), its design probability is the product of the sequential assignment probabilities along that path: $$ P_D(A=a)=\prod_{i=1}^{n}P_D(A_i=a_i\mid H_{i-1}(a)). $$ Here \(H_{i-1}(a)\) is the history that the candidate path generates, using the null-imputed outcomes where the null specifies them and the observed outcomes for participants whose assignments are held fixed.

Choose a statistic \(T\) that targets the prespecified subgroup, such as a difference in subgroup means when both arms are represented, or a weighted score using the known sequential assignment probabilities. For a two-sided test, one common exact p-value is the conditional probability, under the replay distribution, of a statistic at least as extreme in absolute value as the observed statistic. The statistic and direction of a one-sided test should be chosen before inspecting the treatment results.

A justification for the conditional test

The validity argument is a finite-sample randomization argument. Under \(H_0^S\), outcomes for members of \(S\) do not change when their assignments change. Conditional on the observed assignments outside \(S\), the fixed outside outcomes also remain the outcomes under those fixed assignments. Thus every candidate path in the conditional support has a fully determined history for calculating its design probability. The replay probabilities, normalized over compatible paths, give the assignment distribution conditional on the observed outside assignments.

$$ P_D(A_S=a_S\mid A_{-S}=a_{-S},H_0^S) = \frac{P_D(A=(a_S,a_{-S}))} {\displaystyle\sum_{b_S\in\mathcal{C}}P_D(A=(b_S,a_{-S}))}, $$

In this expression, \(A_S\) denotes the assignments within the subgroup, \(A_{-S}\) the assignments outside it, and \(\mathcal{C}\) the subgroup assignment paths compatible with the design and the conditioning event. For each path, calculate \(T\) from the resulting assignments and null-imputed subgroup outcomes. Summing the conditional probabilities of paths for which \(|T|\geq |T_{\mathrm{obs}}|\) gives the two-sided p-value. Under the sharp null, this is a valid randomization p-value: its probability of being at most a chosen level \(\alpha\) is no greater than \(\alpha\). Discrete distributions and ties can make the test conservative.

This argument depends on faithfully reproducing the assignment rule, including any restrictions on allowable allocations, randomization probabilities, or stopping rules that affect the assignment paths. It does not require a large-sample approximation. It does require that the relevant design probabilities and histories are known well enough to calculate the conditional distribution.

Worked Example: Defining the subgroup null

Suppose a hypothetical trial defines \(S\) before randomization as participants whose baseline risk score is at least 8. There are 40 such participants. The planned question is whether treatment has any effect for these 40 participants. State the sharp null and explain what is held fixed in a test.

The null is \(Y_i(1)=Y_i(0)\) for each of the 40 participants in \(S\). It does not assert that the outcomes are equal across different participants; it asserts that each participant’s own outcome would be unchanged by treatment. For each member of \(S\), the observed outcome therefore supplies the outcome under either assignment in every replay.

A participant with a score below 8 is outside \(S\). The subgroup null makes no claim about that participant’s treatment effect. If the outside participant’s treatment assignment is held at its observed value in a conditional test, the observed outcome is known for that fixed assignment. But if a proposed replay changes that participant’s assignment, the subgroup null does not tell us the corresponding counterfactual outcome. This is why the test must either condition appropriately, use a stronger null, or provide another justified way to determine the needed outcomes.

The threshold is legitimate for this test because it was set using baseline information. Defining the subgroup after seeing which participants appeared to benefit would make the tested group outcome-selected and invalidate the stated randomization argument unless that selection were included in the testing procedure.

Worked Example: An exact replay calculation

Consider a hypothetical three-participant trial. Participants 1 and 2 form the baseline subgroup \(S\); participant 3 is outside it. Participant 1 is assigned treatment with probability \(0.5\). Participant 2 is assigned treatment with probability \(0.75\) if participant 1’s observed outcome is 1, and \(0.25\) otherwise. Participant 3 is assigned treatment with probability \(0.5\), independently of the preceding history. Suppose the observed subgroup outcomes are \(Y_1=1\) and \(Y_2=2\), and the observed assignments are \(A_1=1,A_2=0,A_3=1\). Test the two-sided sharp null in \(S\), conditional on \(A_3=1\).

Under the subgroup sharp null, the outcomes 1 and 2 remain fixed for participants 1 and 2 in every replay. Therefore participant 2’s treatment probability is \(0.75\) in every candidate path: participant 1’s outcome is always 1. The probability of the fixed outside assignment \(A_3=1\) is \(0.5\) for every path, so that common factor cancels on conditioning. The four subgroup assignment paths and their conditional probabilities are:

\((A_1,A_2)\)Conditional probabilitySubgroup statistic
(1,1)\(0.5(0.75)=0.375\)\(2+2/0.75=4.667\)
(1,0)\(0.5(0.25)=0.125\)\(2-2/0.25=-6.000\)
(0,1)\(0.5(0.75)=0.375\)\(-2+2/0.75=0.6667\)
(0,0)\(0.5(0.25)=0.125\)\(-2-2/0.25=-10.00\)

The statistic in the table is the sequential inverse-probability score \(T=\sum_{i\in S}\{A_iY_i/\pi_i-(1-A_i)Y_i/(1-\pi_i)\}\). For example, participant 1 contributes \(1(1)/0.5=2\) if treated and \(-1/(1-0.5)=-2\) if assigned control. Participant 2 contributes \(2/0.75=2.667\) if treated and \(-2/(1-0.75)=-8\) if assigned control. These probabilities are recalculated under each replayed history; here they happen to be unchanged because the first outcome is fixed by the null.

The observed statistic is \(-6.000\). At least as extreme in absolute value are the paths with statistics \(-6.000\) and \(-10.00\), with total probability \(0.125+0.125=0.250\). Thus the exact two-sided conditional p-value is \(0.250\). At a 5% significance level, this test does not reject the sharp subgroup null. The result is not evidence that the null is true; it says that this statistic is not unusually extreme under the specified null and assignment mechanism.

Subgroup effects are not interaction effects

A test of \(H_0^S\) asks whether treatment has no effect for any participant in \(S\). An interaction question asks whether the treatment effect differs between \(S\) and its complement. Rejection of the subgroup sharp null does not establish an interaction: treatment might have the same nonzero effect in both groups. Conversely, the subgroup sharp null might hold while effects outside \(S\) are nonzero, which would be evidence of heterogeneity if those outside effects were established.

Worked Example: Same subgroup effect, no interaction

In a hypothetical set of potential outcomes, two participants in \(S\) have \((Y_i(0),Y_i(1))=(10,14)\) and \((8,12)\). Two participants outside \(S\) have the same pairs. Each subgroup’s average treatment effect is \(4\) outcome units: for \(S\), \(\{(14-10)+(12-8)\}/2=4\), and outside \(S\), \(\{(14-10)+(12-8)\}/2=4\). The difference between these subgroup average effects is \(4-4=0\), so there is no average treatment-effect interaction in this example. Yet the sharp null of no effect in \(S\) is false for every member of \(S\).

Now suppose instead that both participants in \(S\) have zero individual treatment effects, while both participants outside \(S\) have effects of \(4\) outcome units. The sharp null in \(S\) holds, but the subgroup average effects differ by \(0-4=-4\) outcome units. These examples show why a subgroup-effect test and an interaction test answer different questions. In practice, a test of a weaker interaction null about average effects does not generally become an exact sharp-null test simply by using a subgroup-specific statistic.

Diagnostics, alternatives, and limitations

Before reporting a result, verify that the subgroup rule used only baseline information and was fixed before examining outcomes. Check the recorded adaptive probabilities against the protocol or implementation, and confirm that replaying a candidate path updates every history-dependent probability. In a conditional test, verify that the observed outside assignments define a nonempty conditional support and that the probabilities of compatible paths are normalized to sum to 1.

A common mistake is to permute treatment labels only among subgroup participants while leaving their observed assignment probabilities unchanged. That is generally wrong: if a previous reassigned outcome would change a later probability, the permutation distribution is not the distribution generated by the design. The correction is to replay the full assignment mechanism, including the probabilities of fixed outside assignments when they depend on the replayed history, and then evaluate the subgroup statistic.

Another common mistake is to interpret a significant subgroup test as proof that the treatment effect is larger in that subgroup. The test concerns a sharp no-effect null within \(S\), not equality of effects between groups. A model-based treatment-by-subgroup interaction analysis may target the latter question, but it relies on its own modeling and uncertainty assumptions. A simple randomization test that conditions on allocation counts or ignores adaptive probabilities is not automatically exact for the adaptive design.

The conditional approach has limits. Conditioning can reduce the number of possible subgroup assignment paths and therefore reduce power; in extreme cases it leaves no randomization variation. Sharp-null tests also do not directly provide confidence intervals for a weak null about an average subgroup effect. If paths are sampled rather than enumerated, a Monte Carlo p-value should account for simulation uncertainty and should use the correct replay distribution; simulation does not repair an incorrect assignment model. Finally, very small probabilities can make weighted statistics unstable even when the randomization test itself is valid.

Key takeaway: An exact test of a prespecified subgroup sharp null requires a subgroup-focused statistic and a design-correct randomization distribution. Replay the full adaptive mechanism under the null, condition on outside assignments when needed and justified, and do not confuse evidence of an effect within a subgroup with evidence of an interaction.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A subgroup is defined by a baseline score recorded before randomization. What makes the no-effect null within that subgroup sharp?
  2. In an adaptive trial, why might the assignment probability for a later subgroup participant need to be recalculated in each replay?
  3. A two-sided replay distribution assigns probability 0.08 to paths with \(|T|\geq |T_{\mathrm{obs}}|\). What is the exact p-value, and what is the decision at \(\alpha=0.05\)?
  4. Suppose the average treatment effect is 3 outcome units both inside and outside a subgroup. Does that establish the subgroup sharp null or a nonzero interaction?

Solutions. (1) It specifies each subgroup member’s two potential outcomes as equal, so the observed outcome supplies that member’s outcome under every replayed assignment. (2) The probability may depend on the history generated by earlier assignments and outcomes; a changed earlier assignment can change that history and hence the later probability. (3) The p-value is \(0.08\). Since \(0.08>0.05\), do not reject the sharp null at the 5% level. (4) No. Equal average effects imply a difference of \(3-3=0\) outcome units, not a nonzero average interaction; they also do not establish the sharp subgroup null, which requires zero individual effects for every subgroup member.

Clinical Biostats