Why Match Within Prespecified Subgroups?
Treatment effects may differ across clinically or scientifically meaningful groups. For example, the effect of a treatment may differ by disease stage, age category, or a baseline risk group. Matching separately within such groups prevents a treated unit in one group from being paired with a control unit in another. It also makes the subgroup-specific target explicit: the question is not merely whether the matched groups look similar overall, but what effect is being estimated within each subgroup and how those effects will be combined.
A subgroup must be defined using information available before treatment, and it should be specified before examining outcome differences whenever possible. Choosing subgroup boundaries after seeing the results can make estimates difficult to interpret and can exaggerate apparent differences. The introductory material on exact matching and stratum-weighted effects provides the general context for within-stratum comparisons; here the emphasis is on conditional targets and aggregation across prespecified subgroups.
If the target population has subgroup proportions \(q_s= P_Q(S=s)\), where \(q_s\geq 0\) and \(\sum_{s=1}^K q_s=1\), its aggregate effect is
This is a population average, not necessarily an unweighted average of the subgroup estimates. The appropriate weights are the subgroup proportions in the population the aggregate is intended to describe. If matching targets treated units, for instance, the relevant proportions are the treated units’ subgroup proportions in the target set—not automatically the proportions among all eligible units or in the matched sample.
Assumptions and What Within-Subgroup Matching Targets
Within-subgroup matching is a design strategy, not an assumption-free way to create causal comparisons. Let \(A\in\{0,1\}\) indicate treatment and let \(X\) denote measured pretreatment covariates used for matching. A common identification argument requires the following conditions in each subgroup that contributes to the target:
- Consistency and no interference: the observed outcome is \(Y=Y(A)\), and one unit’s treatment does not change another unit’s outcome.
- Conditional exchangeability: \((Y(1),Y(0))\) is independent of \(A\) given \(X\) and \(S\). In words, within the subgroup and at the same measured covariate values, treatment assignment is not associated with the potential outcomes.
- Within-subgroup positivity: for covariate values represented in the target, \(0<P(A=1\mid X,S=s)<1\). There must be treated and control opportunities for comparison within the relevant subgroup and covariate region.
Under these assumptions, the conditional contrast in observed outcome means identifies the conditional mean treatment effect:
Averaging that conditional contrast over the target covariate distribution within subgroup \(s\) gives \(\tau_s^Q\). Matching approximates this comparison by pairing or otherwise comparing units within the same subgroup with similar \(X\). What the resulting estimate targets depends on which units are represented after matching and how their contrasts are averaged. If treated units are matched to controls, the natural target is often the average effect among the matched treated units in that subgroup. That is not automatically the subgroup ATE for all eligible units.
Why the Aggregate Formula Holds
The aggregation rule follows by partitioning the target population according to its subgroup label. Because the subgroups are mutually exclusive and exhaustive within the target, the law of total expectation gives:
Here \(I(S=s)\) equals 1 for units in subgroup \(s\) and 0 otherwise. The identity is exact for the specified target population. Its practical use depends on estimating each \(\tau_s^Q\) for the intended subgroup target and using the corresponding \(q_s\). Combining estimates from different target populations, or using weights from a different population, does not generally recover the stated aggregate effect.
Worked Example: Matching Within Two Subgroups
Suppose a hypothetical study prespecified two age subgroups. Within each subgroup, treated patients were matched to comparable controls, and the design is intended to estimate effects among the matched treated patients. The outcome is a symptom score, with lower scores better. For simplicity, suppose the paired treatment-minus-control outcome differences are as follows.
| Subgroup | Matched-pair differences (score points) | Number of treated pairs |
|---|---|---|
| Younger | -2, -1, -3 | 3 |
| Older | -4, -2 | 2 |
For the younger subgroup, the mean paired difference is
For the older subgroup, it is
These estimates describe matched treated patients in their respective subgroups, assuming the matching and identification conditions support that interpretation. Among the five matched treated patients, the subgroup proportions are \(3/5=0.60\) and \(2/5=0.40\). Thus the aggregate matched-treated estimate is
The interpretation is an estimated 2.4-point reduction in symptom score for the matched treated population, on average. It does not establish an effect for all eligible patients unless the matched treated units represent that broader target and the assumptions are credible.
Choose Weights for the Intended Target
Subgroup estimates alone do not determine an aggregate. The same subgroup effects can yield different aggregate effects when the target population has a different subgroup composition. This is not a contradiction: the resulting quantities answer different population questions. The weights must be chosen from the target definition, not from whichever counts are easiest to obtain.
Worked Example: The Same Effects, Two Target Populations
Suppose, hypothetically, that valid subgroup estimates are \(\hat{\tau}_1=2.0\) outcome units and \(\hat{\tau}_2=4.0\) outcome units. Assume these estimates are applicable to each target considered. In a target population with subgroup proportions \(q_1=0.75\) and \(q_2=0.25\), the estimated aggregate is
Now consider a different target population with proportions \(q_1=0.40\) and \(q_2=0.60\). Its estimated aggregate is
The subgroup estimates did not change; the population being summarized did. If the first set of proportions defines the eligible population, reporting 3.20 as that population’s aggregate merely because the matched sample happened to have a 40%/60% split would answer the wrong target question.
Diagnostics and Failure Modes
A pooled balance summary can conceal a poor comparison in one subgroup. Assess the matching design within each subgroup, including the covariates used for matching and the number and characteristics of units retained. The following checks are especially important:
- Check overlap separately by subgroup. A subgroup can lack suitable controls even when the full sample has many controls. Inspect covariate distributions and whether treated units have plausible within-subgroup comparators.
- Check balance within subgroup. Good overall balance does not guarantee that each subgroup is balanced. A large subgroup can dominate an aggregate diagnostic while a smaller subgroup remains imbalanced.
- Record who was not matched. If unmatched units differ systematically from retained units, the matched estimate may target a selected subset rather than the prespecified subgroup population. Report subgroup-specific retention and state the resulting target honestly.
- Check subgroup sizes and estimate stability. Small subgroups may produce imprecise effects, and a single unusual matched contrast can have substantial influence. A point estimate alone does not show its uncertainty.
- Check that subgroup definitions are pretreatment and prespecified. Defining groups using post-treatment information can condition on a consequence of treatment and distort the comparison. Trying many cut points and emphasizing the most favorable result also weakens interpretation.
When positivity fails in a subgroup, matching cannot supply the missing counterfactual comparison from the observed data. Restricting the target to a region with adequate overlap may be defensible, but it changes the target and should be stated. Extrapolating from another subgroup requires additional substantive assumptions; it is not justified merely because the groups share a broad label.
Worked Example: A Subgroup With No Suitable Controls
In a hypothetical evaluation, investigators prespecify a high-risk subgroup and plan to match treated units to controls within that subgroup. The data contain 18 treated patients in the subgroup but no control patients with covariate values in the treated patients’ range of baseline severity.
The design has no credible within-subgroup control comparisons for those treated patients. The subgroup-specific matched contrast cannot be calculated for them, and the within-subgroup positivity condition fails in the relevant covariate region. The fact that 200 controls are available in other risk groups does not repair this failure: comparisons across the prespecified subgroup boundary would not be within-subgroup matches.
A defensible report would state that the intended high-risk treated target is unsupported by the available overlap. Investigators could define a narrower target with actual comparators if substantively justified, or use a different analysis that relies on explicit extrapolation assumptions. Neither choice makes the original full high-risk target identified by the matching data alone.
How This Choice Differs From Alternatives
Matching within prespecified subgroups is useful when cross-subgroup comparisons are not scientifically appropriate and subgroup-specific effects are themselves important. It makes the restriction visible and gives a direct route to conditional estimates, but dividing the data can reduce the number of available matches and expose lack of overlap that a pooled summary might hide.
Pooled matching uses one matching design across subgroups. It may retain more units, but can pair units across groups unless the design explicitly forbids it; a pooled estimate then need not answer the desired within-subgroup question. Exact matching on subgroup labels is one way to enforce the boundary, while separate matching designs make subgroup-specific diagnostics and targets more explicit. A model-based analysis can also estimate conditional contrasts, but it requires a suitable model and does not remove the need to define the target population or assess support in each subgroup.
Neither a simple average of subgroup estimates nor the matched sample’s raw subgroup composition is universally correct. The correct aggregate is the one aligned with the target population. Conversely, an aggregate alone can obscure meaningful subgroup-specific differences, so reporting the subgroup estimates alongside a clearly defined aggregate is often more informative.
Common Mistakes
- Wrong: “The subgroups are equally important, so I will always average their effects equally.” Correction: Equal weights describe a particular artificial target with equal subgroup proportions. Use the proportions of the population named by the estimand.
- Wrong: “The subgroup estimates are ATT estimates, so their average is the overall ATT.” Correction: The overall treated-unit effect uses the treated target’s subgroup proportions, and the subgroup estimates must correspond to treated units from that same target.
- Wrong: “There are many controls overall, so every subgroup has enough overlap.” Correction: Positivity and match availability must be checked within each subgroup and relevant covariate region.
- Wrong: “The matched sample’s composition is automatically the population composition.” Correction: Matching and exclusions can alter subgroup representation. State whether the target is the retained matched population or a broader population.
Check Your Understanding
Answer each question by identifying the target and showing the relevant calculation or reasoning.
- Two subgroup effects are 1.5 and 3.5 units. The target population is 80% subgroup 1 and 20% subgroup 2. What is the aggregate effect?
- Why does a treated-to-control matched contrast within subgroup \(s\) not automatically estimate the ATE for everyone in that subgroup?
- A matched sample is 50% subgroup 1, while the prespecified target population is 70% subgroup 1. Which proportions should weight the subgroup effects for the target-population aggregate?
- There are many controls overall, but no controls comparable to treated units in one subgroup. What assumption or design condition is at issue?
Solutions. (1) \((0.80)(1.5)+(0.20)(3.5)=1.20+0.70=1.90\) units. (2) Treated-to-control matching commonly targets the matched treated units; those units need not represent all subgroup members, and an ATE includes effects for both treated and untreated members of the stated subgroup population. (3) Use 0.70 for subgroup 1 and 0.30 for subgroup 2, because those are the target population proportions; the matched sample’s composition is not automatically the target composition. (4) Within-subgroup positivity, or practical availability of comparable controls, fails for that subgroup’s treated units, so the intended comparison is unsupported by those data.