Tutorials › Causal Inference › Worked Subgroup Analysis from Estimand to Report

Effect Modification and Subgroup Effects · Tutorial 874 of 972

Worked Subgroup Analysis from Estimand to Report

Work through a randomized-trial subgroup analysis, from defining its causal estimands to interpreting effect estimates, interaction evidence, and multiplicity-adjusted results.

Advanced 11 min read

What You'll Learn

  • Define subgroup-specific causal effects for a baseline-defined population in a randomized trial.
  • Estimate subgroup risks, risk differences, risk ratios, and relative risk reductions from trial counts.
  • Calculate and interpret an additive interaction contrast and its confidence interval.
  • Distinguish evidence about a subgroup effect from evidence that effects differ between subgroups.
  • Apply a Bonferroni correction to a specified family of subgroup tests.
  • Write a results summary that reports uncertainty without overstating subgroup findings.

From a Subgroup Question to a Causal Estimand

A subgroup analysis is most informative when its question is specified before examining outcomes. The target subgroup should be defined using a baseline characteristic, the treatment contrast and outcome should be clear, and the scale of comparison should be named. Without those choices, estimates that appear to answer the same question may refer to different populations or different notions of effect.

Consider a hypothetical individually randomized trial of a treatment intended to prevent an adverse outcome. Let \(A=1\) denote assignment to treatment and \(A=0\) assignment to control; let \(Y=1\) indicate that the adverse outcome occurs; and let \(S\) be a baseline risk category, with \(S=1\) for high risk and \(S=0\) for lower risk. The subgroup variable is measured before randomization, so it cannot be changed by treatment assignment.

Definition: Let \(Y(1)\) and \(Y(0)\) denote the outcome that a participant would have under assignment to treatment and control, respectively. The subgroup-specific average treatment effect on the risk-difference scale is \(\Delta_s=E[Y(1)-Y(0)\mid S=s]\). For a binary adverse outcome, this is the treatment-arm risk minus the control-arm risk in subgroup \(s\). A negative value indicates lower adverse-outcome risk under treatment.

This estimand is defined for each subgroup in its own target population: participants with \(S=s\). It is an intention-to-treat contrast if \(A\) represents randomized assignment, regardless of whether participants follow their assigned regimen. A relative-scale estimand can also be defined as the subgroup risk ratio \(RR_s=E[Y(1)\mid S=s]/E[Y(0)\mid S=s]\), provided the control risk is positive. A risk ratio below one favors treatment for an adverse outcome.

A causal interpretation requires that the randomized assignment is independent of the potential outcomes within the baseline subgroup, that the observed outcome equals the potential outcome under the assigned treatment (consistency), and that one participant’s assignment does not affect another participant’s outcome (no interference). We also assume the outcomes are observed for all participants in this illustrative data set. In a real trial, missing outcomes require additional assumptions and methods. Randomization supports the within-subgroup comparison because \(S\) is measured at baseline; selecting a subgroup based on a post-treatment variable would not have this justification.

Hypothetical Trial Data and Subgroup Effects

Suppose the trial has 200 participants assigned to each arm within each subgroup. The following table gives the number with the adverse outcome and the corresponding observed risk. All numbers are hypothetical.

Baseline subgroupTreatment: outcomes / nTreatment riskControl: outcomes / nControl risk
High risk (\(S=1\))40 / 2000.20060 / 2000.300
Lower risk (\(S=0\))18 / 2000.09020 / 2000.100

Worked Example: Estimate Effects on Absolute and Relative Scales

For each subgroup, estimate the treatment and control risks, the risk difference, and the risk ratio. Use the observed proportion in each randomized arm as the estimate of its risk.

High-risk subgroup. The treatment risk is \(40/200=0.200\), or 20.0%, and the control risk is \(60/200=0.300\), or 30.0%. Thus

$$ \widehat{\Delta}_1=0.200-0.300=-0.100 $$

The estimated absolute effect is a reduction of 10.0 percentage points in adverse-outcome risk. On the relative scale,

$$ \widehat{RR}_1=\frac{0.200}{0.300}=0.667, \qquad 1-\widehat{RR}_1=1-0.667=0.333. $$

The estimated risk is about 0.667 times as large under treatment as under control, corresponding to a relative risk reduction of about 33.3%.

Lower-risk subgroup. The treatment risk is \(18/200=0.090\), or 9.0%, and the control risk is \(20/200=0.100\), or 10.0%. Therefore

$$ \widehat{\Delta}_0=0.090-0.100=-0.010, \qquad \widehat{RR}_0=\frac{0.090}{0.100}=0.900. $$

The estimated absolute reduction is 1.0 percentage point, while the relative risk reduction is 10.0%. These are different descriptions of the same pair of risks within this subgroup. Neither alone establishes that the treatment effect truly differs by subgroup.

Absolute effects are often directly useful for decisions because they describe the change in outcome probability, in percentage points. Relative effects describe proportional change. The scale matters: a treatment can have different subgroup contrasts on the risk-difference scale and on the risk-ratio scale. Any claim of effect modification therefore needs to name its scale.

Uncertainty for Subgroup Effects and Their Contrast

For this worked analysis, use independent binomial sampling within each treatment-by-subgroup cell and a normal approximation for the estimated risk differences. For two independent proportions \(\hat p_1\) and \(\hat p_0\), the estimated variance of their difference is \(\hat p_1(1-\hat p_1)/n_1+\hat p_0(1-\hat p_0)/n_0\). This approximation is used here as a transparent large-sample calculation; other settings may call for different interval or test procedures.

Worked Example: Calculate Subgroup Confidence Intervals

For the high-risk subgroup, the estimated standard error of the risk difference is

$$ SE_1=\sqrt{\frac{0.200(0.800)}{200}+\frac{0.300(0.700)}{200}} =\sqrt{0.000800+0.001050} =\sqrt{0.001850} =0.04301. $$

A nominal 95% confidence interval is the estimate plus or minus 1.96 standard errors:

$$ -0.100\pm1.96(0.04301) =-0.100\pm0.08430 =(-0.1843,\,-0.0157). $$

Thus, under the stated sampling approximation, the high-risk subgroup’s treatment-minus-control risk difference is estimated to be between a 18.4-percentage-point reduction and a 1.6-percentage-point reduction. The interval describes uncertainty from sampling; it is not a probability statement about the fixed estimand.

For the lower-risk subgroup,

$$ SE_0=\sqrt{\frac{0.090(0.910)}{200}+\frac{0.100(0.900)}{200}} =\sqrt{0.0004095+0.0004500} =\sqrt{0.0008595} =0.02932, $$

and its nominal 95% interval is

$$ -0.010\pm1.96(0.02932) =-0.010\pm0.05746 =(-0.0675,\,0.0475). $$

The lower-risk data are compatible with effects ranging from a 6.75-percentage-point reduction to a 4.75-percentage-point increase. The point estimate is small, but the interval also shows that the estimate is imprecise enough to include effects in either direction.

To assess additive effect modification, compare the two subgroup risk differences. Define the additive interaction contrast as \(\delta=\Delta_1-\Delta_0\). It is the difference between the treatment effects on the risk-difference scale, not either subgroup’s treatment effect on its own. Here, the estimated contrast is \(-0.100-(-0.010)=-0.090\), or 9.0 percentage points more reduction in the high-risk subgroup.

Worked Example: Estimate and Test the Additive Interaction

Because the subgroup samples are disjoint, the two estimated subgroup risk differences are independent under the working sampling model. The estimated variance of their difference is therefore the sum of their estimated variances:

$$ SE(\widehat{\delta}) =\sqrt{SE_1^2+SE_0^2} =\sqrt{0.001850+0.0008595} =\sqrt{0.0027095} =0.05205. $$

For the null hypothesis of no additive interaction, \(H_0:\delta=0\), the normal-approximation statistic is

$$ z=\frac{\widehat{\delta}-0}{SE(\widehat{\delta})} =\frac{-0.090}{0.05205} =-1.729. $$

The two-sided normal-approximation p-value is about 0.084. The 95% confidence interval is

$$ -0.090\pm1.96(0.05205) =-0.090\pm0.1020 =(-0.1920,\,0.0120). $$

This interval includes zero, and the test does not reject \(H_0\) at the 0.05 level. The estimated additive interaction favors a larger reduction in the high-risk subgroup, but these data do not provide conventional statistical evidence that the subgroup risk differences differ. That conclusion does not establish that the effects are equal.

The interaction test answers a different question from the two tests of whether each subgroup’s effect equals zero. In particular, finding a statistically significant estimate in one subgroup and a non-significant estimate in another does not itself show that their effects differ. The direct comparison is the interaction contrast and its uncertainty.

Multiplicity and a Cautious Results Report

If subgroup effects are tested repeatedly, the chance of at least one false-positive finding can exceed the nominal significance level. The correction depends on the family of claims that the analysis intends to make. For illustration, suppose the family is defined in advance as the two subgroup-specific tests of \(H_0:\Delta_s=0\), one for each subgroup. A Bonferroni procedure controls the family-wise error rate at 0.05 by testing each two-sided hypothesis at \(0.05/2=0.025\), or by multiplying each unadjusted p-value by two, up to one.

Worked Example: Apply Bonferroni to the Two Subgroup Tests

The high-risk subgroup statistic is \(-0.100/0.04301=-2.326\), giving an approximate two-sided unadjusted p-value of 0.020. Its Bonferroni-adjusted p-value is

$$ \min(2\times0.020,1)=0.040. $$

It is below 0.05, so this subgroup-specific test crosses the Bonferroni-adjusted threshold. For the lower-risk subgroup, the statistic is \(-0.010/0.02932=-0.341\), with an approximate unadjusted p-value of 0.733. Its adjusted p-value is \(\min(2\times0.733,1)=1.000\), so it does not cross the threshold.

The equivalent Bonferroni simultaneous intervals use 97.5% confidence for each subgroup estimate, with normal critical value about 2.241. For high risk:

$$ -0.100\pm2.241(0.04301) =-0.100\pm0.0964 =(-0.1964,\,-0.0036). $$

For lower risk:

$$ -0.010\pm2.241(0.02932) =-0.010\pm0.0657 =(-0.0757,\,0.0557). $$

The high-risk simultaneous interval excludes zero, whereas the lower-risk interval includes zero, consistent with the adjusted tests. The correction applies to the specified family of two tests; if many subgroups, outcomes, or analyses were searched, that larger selection process would need to be considered in defining and addressing multiplicity.

The subgroup-specific Bonferroni result does not overturn the interaction result. The high-risk estimate is statistically distinguishable from zero under this specified family-wise procedure, but the estimated difference between subgroup effects still has a 95% interval that includes zero. A subgroup effect can be distinguishable from zero even when the evidence that it differs from another subgroup’s effect is inconclusive.

A concise report should state the subgroup definition, risks in both arms, the effect scale, uncertainty, and the analysis plan’s multiplicity treatment. It should also distinguish the estimated direction and size of heterogeneity from the strength of evidence for it. For these hypothetical data, an appropriate summary is:

Example report: Among participants classified as high risk at baseline, adverse-outcome risk was 20.0% with treatment and 30.0% with control (risk difference, \(-10.0\) percentage points; nominal 95% CI, \(-18.4\) to \(-1.6\)). In the lower-risk subgroup, risks were 9.0% and 10.0%, respectively (risk difference, \(-1.0\) percentage point; nominal 95% CI, \(-6.7\) to \(4.7\)). The estimated difference between subgroup risk differences was \(-9.0\) percentage points (95% CI, \(-19.2\) to \(1.2\); \(p=0.084\)), so the analysis did not establish additive effect modification. In a Bonferroni family of two subgroup-effect tests, the high-risk test met the adjusted 0.05 threshold (\(p_{\mathrm{adj}}\approx0.040\)); the lower-risk test did not (\(p_{\mathrm{adj}}=1.000\)). These estimates are uncertain and should be interpreted in light of the prespecified subgroup and multiplicity plan.

Common Pitfalls

  • Equating one significant subgroup result with heterogeneity. A test against zero within one subgroup does not test whether subgroup effects differ. Use the direct contrast \(\Delta_1-\Delta_0\) to assess additive effect modification.
  • Reporting a subgroup effect without naming its scale. A 10-percentage-point risk difference and a 33.3% relative risk reduction describe the high-risk estimate differently. Neither is a scale-free summary.
  • Treating a non-significant interaction as proof of no difference. The interaction interval here includes both a meaningful additional reduction and a small difference in the opposite direction. Failure to reject zero is not proof of equivalence.
  • Ignoring the analysis family. An unadjusted p-value does not account for searching across multiple subgroup hypotheses. State what family was considered and which correction was applied.
  • Overstating a randomized subgroup result. Randomization supports causal comparisons within a subgroup defined at baseline, subject to the stated assumptions. It does not make every post hoc pattern reliable or show that subgroup membership itself causes different treatment response.

A disciplined subgroup analysis links each claim to its estimand: report treatment effects within the named baseline populations, compare those effects directly when asking about heterogeneity, and express uncertainty on the same scale as the claim. Statistical evidence should then be interpreted alongside the size and clinical relevance of the estimated effects, rather than as a substitute for them.

Check Your Understanding

Use the hypothetical trial data and definitions above to answer the following.

  1. Write the risk-difference estimand for the high-risk subgroup in terms of potential outcomes. What does a negative value mean for this adverse outcome?
  2. Calculate the lower-risk treatment risk ratio and state its interpretation in context.
  3. Why does the contrast \(\Delta_1-\Delta_0\) answer a different question from testing whether \(\Delta_1=0\)?
  4. Explain why a high-risk subgroup p-value below 0.05 and a lower-risk p-value above 0.05 do not, by themselves, establish effect modification.
  5. For a Bonferroni family of two subgroup tests at family-wise level 0.05, what per-test significance level is used, and which subgroup test crosses that threshold here?
Clinical Biostats