Tutorials › Propensity Score Matching and Instrumental Variables › Stratified Adjustment With a Binary Confounder

Randomization Versus Observational Data · Tutorial 34 of 699

Stratified Adjustment With a Binary Confounder

Calculate within-stratum treatment contrasts and combine them into an effect for a clearly defined target population.

Beginner 10 min read

What You'll Learn

  • Define a standardized treatment contrast for a binary pretreatment confounder.
  • State the assumptions needed to identify the contrast from observed data.
  • Calculate stratum-specific contrasts and average them using target-population proportions.
  • Distinguish standardized estimates from crude comparisons and from estimates for other target populations.
  • Recognize sparse strata, missing treatment groups, and inappropriate target weights as warning signs.

Why Compare Within Strata?

Suppose treatment is more common among people with a high-risk baseline characteristic, and those people also tend to have worse outcomes. A crude comparison of all treated people with all untreated people mixes two differences: treatment status and the groups’ baseline composition. Stratification addresses this problem for a measured binary pretreatment variable by comparing treated and untreated people separately within each of its two categories.

The within-stratum comparisons are not automatically causal. Their causal interpretation requires assumptions about treatment assignment and the relationship between the study data and the target population. Once those assumptions are stated, the stratum-specific contrasts can be combined using the target population’s proportions in the two strata. The weights matter: they determine whose average effect the final contrast describes.

Definition: Let \(A\) be a binary treatment, with \(A=1\) denoting treatment and \(A=0\) denoting no treatment. Let \(Z\) be a binary pretreatment covariate, with strata \(Z=0\) and \(Z=1\). Let \(Y(1)\) and \(Y(0)\) denote the outcomes a person would have under treatment and no treatment, respectively. For a target population with stratum proportions \(q_0=P_{\text{target}}(Z=0)\) and \(q_1=P_{\text{target}}(Z=1)\), where \(q_0+q_1=1\), the stratified standardized treatment contrast is the target-weighted average of the two stratum-specific contrasts.

Write \(\mu_{az}=E(Y\mid A=a,Z=z)\) for the observed mean outcome among people with treatment status \(a\) in stratum \(z\). The observed stratum-specific contrast is \(\mu_{1z}-\mu_{0z}\). Standardization combines these contrasts as follows:

$$ \Delta_{\text{target}} = q_0(\mu_{10}-\mu_{00}) + q_1(\mu_{11}-\mu_{01}) $$

For a quantitative outcome, this contrast is measured in the outcome’s units. For a binary outcome, the means are risks and the contrast is a risk difference, measured in probability units or percentage points. The target weights are not necessarily the proportions of strata among treated people, untreated people, or the full study sample. They should represent the population whose effect is being described.

Assumptions and Identification

The calculation above is descriptive until its assumptions justify interpreting it as a causal contrast. For the target population represented by the data, the key assumptions are:

  • Consistency: a person’s observed outcome equals \(Y(A)\), the potential outcome under the treatment actually received. Treatment versions must be sufficiently well defined for this equality to be meaningful.
  • No interference: one person’s outcome is not changed by other people’s treatment assignments, or the treatment and outcome definitions otherwise account for interference.
  • Conditional exchangeability: within each stratum, treatment assignment is independent of the potential outcomes: \(Y(a)\perp A\mid Z\), for \(a=0,1\). In words, after fixing \(Z\), treated and untreated people are comparable with respect to their potential outcomes.
  • Positivity: each treatment status occurs with positive probability in each target stratum: \(0<P(A=a\mid Z=z)<1\) for both treatment values and each stratum with positive target weight.

Conditional exchangeability is an assumption about treatment assignment, not a consequence of calculating separate means. It is more plausible when the relevant pretreatment causes of treatment and outcome have been measured and represented by the adjustment set. Stratifying on one measured binary variable cannot, by itself, rule out confounding by other factors.

The identification argument follows by averaging potential outcomes over the target strata. Within a stratum, conditional exchangeability lets us replace the mean potential outcome under \(a\) with the mean among people who actually received \(a\). Consistency then equates that observed outcome with the corresponding potential outcome:

$$ \begin{aligned} E_{\text{target}}[Y(a)] &=\sum_{z=0}^{1} E_{\text{target}}[Y(a)\mid Z=z]P_{\text{target}}(Z=z)\\ &=\sum_{z=0}^{1} E[Y(a)\mid A=a,Z=z]q_z\\ &=\sum_{z=0}^{1} E[Y\mid A=a,Z=z]q_z. \end{aligned} $$

Subtracting the expression for \(a=0\) from the expression for \(a=1\) yields the standardized contrast. If the target population differs from the population that supplied the outcome data, this argument also requires the stratum-specific outcome means to apply to the target population. The target weights alone do not guarantee that transportability.

Calculate the Stratum Contrasts, Then Standardize

Worked Example: A Quantitative Outcome and a Misleading Crude Comparison

Consider hypothetical data on treatment and a symptom score measured at follow-up, where higher scores indicate worse symptoms. Let \(Z=1\) denote high baseline risk and \(Z=0\) low baseline risk. The target population is 40% high risk and 60% low risk.

Baseline risk stratumTreated: sample sizeTreated: mean scoreUntreated: sample sizeUntreated: mean score
Low risk, \(Z=0\)204805
High risk, \(Z=1\)4082012

First calculate the contrasts within strata. For low-risk people, the treated-minus-untreated contrast is \(4-5=-1\) score point. For high-risk people, it is \(8-12=-4\) score points. The target weights are \(q_0=0.60\) and \(q_1=0.40\), so:

$$ \Delta_{\text{target}} =0.60(4-5)+0.40(8-12) =-0.60-1.60 =-2.20\text{ score points}. $$

Under the assumptions stated above, the estimated target-population contrast is 2.20 score points lower with treatment. This is an average contrast for a target population with the specified risk-stratum proportions, not a claim that every individual’s score would fall by 2.20 points.

The crude means tell a different story. The treated mean is \((20\cdot4+40\cdot8)/60=400/60=6.667\) points. The untreated mean is \((80\cdot5+20\cdot12)/100=640/100=6.400\) points. The crude treated-minus-untreated contrast is \(6.667-6.400=0.267\) points. It is positive even though both within-stratum contrasts are negative. The treated group contains a larger share of high-risk people, so the crude comparison reflects different stratum composition as well as treatment status.

Both treatment groups are represented in both strata, so the table does not show a positivity failure. The data do not establish conditional exchangeability; that requires substantive justification about how treatment was assigned and whether relevant confounders were measured.

The Target Weights Change the Question

The same stratum-specific contrasts can produce different standardized contrasts for different target populations. This is not a computational inconsistency: it reflects a change in the population being averaged over. For a binary outcome, the calculation is especially direct because each stratum mean is the event risk.

Worked Example: Standardizing Risks for a Defined Target

Suppose hypothetical follow-up data record whether an event occurred. In the low-risk stratum, 10 of 100 treated people and 15 of 100 untreated people have the event. In the high-risk stratum, the corresponding counts are 40 of 100 treated and 60 of 100 untreated. The target population is 80% low risk and 20% high risk.

The observed risks and stratum-specific risk differences are:

$$ \begin{aligned} \text{Low-risk difference}&=\frac{10}{100}-\frac{15}{100}=0.10-0.15=-0.05,\\ \text{High-risk difference}&=\frac{40}{100}-\frac{60}{100}=0.40-0.60=-0.20. \end{aligned} $$

Thus the target-standardized risk difference is:

$$ \Delta_{\text{target}} =0.80(-0.05)+0.20(-0.20) =-0.040-0.040 =-0.080. $$

The estimated risk is 8 percentage points lower under treatment for this target population, under the identification assumptions. The computation weights the low-risk stratum more heavily because it forms 80% of the target. If the target instead were 30% low risk and 70% high risk, the standardized difference would be \(0.30(-0.05)+0.70(-0.20)=-0.155\), or 15.5 percentage points lower. The stratum-specific data did not change; the target population did.

There are treated and untreated observations in both strata, so positivity is not contradicted by these counts. As before, counts alone cannot verify conditional exchangeability. If the target weights describe a population different from the study population, applying the study’s stratum-specific risks to that target additionally requires those risks to be applicable there.

Worked Example: Using Target Data to Set the Weights

Suppose a hypothetical study estimates treatment contrasts of \(-2\) and \(-6\) hospital days in strata \(Z=0\) and \(Z=1\), respectively. A separate count of the target population finds 300 people in \(Z=0\) and 100 in \(Z=1\). Assume the study’s stratum-specific contrasts are applicable to this target and the identification assumptions hold.

The target proportions are \(q_0=300/(300+100)=0.75\) and \(q_1=100/400=0.25\). Therefore:

$$ \Delta_{\text{target}} =0.75(-2)+0.25(-6) =-1.50-1.50 =-3.00\text{ hospital days}. $$

The estimated average contrast is 3.00 fewer hospital days under treatment in this target population. An equal-weight average would be \(\{(-2)+(-6)\}/2=-4\) days, but that would describe a target with equal proportions in the two strata, not the stated population. The arithmetic also depends on both treatment groups being observed in each stratum in the study; target data provide weights, not missing treatment comparisons.

Diagnostics, Alternatives, and Limitations

Before interpreting a standardized contrast, inspect the four treatment-by-stratum cells. Each stratum with positive target weight needs observations under both treatment conditions. An empty cell means its within-stratum contrast cannot be estimated directly from the observed data; a very small cell makes the estimate unstable and sensitive to a few outcomes. A calculated weighted average cannot repair either problem. Also verify that the weights are nonnegative, sum to one, and correspond to the intended target population.

Compare the stratum-specific contrasts with the crude contrast, but do not expect them to be equal. A difference can signal that treatment groups have different stratum compositions, as in the first example. If stratum-specific effects differ, the target weights determine how strongly each contributes to the overall result. Report the stratum-specific estimates alongside the standardized estimate when that variation matters for interpretation.

Stratified standardization is transparent for a binary covariate: it shows each comparison and the exact weights used. A crude comparison is simpler but can mix treatment differences with baseline composition. In a randomized trial, random assignment supports comparability on average, though chance imbalances may remain in a particular sample. Regression adjustment is another way to adjust for measured covariates, but it uses a model to relate outcome to treatment and covariates; it does not remove the need for appropriate assumptions. For a single binary covariate, direct stratification makes the target weighting particularly visible.

This method has important limits. It adjusts only for the covariates included in the strata; it does not address unmeasured confounding. With many covariates, fine stratification can create sparse or empty cells. The estimated contrast also depends on the chosen outcome scale and target population. A risk difference, for example, need not match a risk ratio, and a contrast for one target distribution need not apply to another. Finally, the standardization formula does not by itself provide a measure of statistical uncertainty; uncertainty assessment must account for how the cell means and, when estimated, the target weights were obtained.

Key takeaway: Estimate the treatment contrast within each stratum, then average those contrasts using the target population’s stratum proportions. The result has a causal interpretation only when the identification assumptions are credible and both treatment conditions are represented in every target-relevant stratum.

Check Your Understanding

Try each problem, then compare your work with the solutions below.

  1. A target population is 25% in stratum \(Z=0\) and 75% in stratum \(Z=1\). The treated-minus-untreated outcome contrasts are \(2\) units and \(-2\) units, respectively. Calculate the standardized contrast.
  2. In a target population, \(q_0=0.60\) and \(q_1=0.40\). The risk difference is \(-0.10\) in \(Z=0\) and \(0.05\) in \(Z=1\). Calculate the target risk difference and express it in percentage points.
  3. In \(Z=1\), the study has treated observations but no untreated observations, while \(q_1>0\). Can the stratum-specific contrast be calculated from the data? Which assumption is implicated?
  4. Two analysts use the same stratum-specific contrasts but different target weights. Must their standardized contrasts agree? Explain.

Solutions. 1. \(0.25(2)+0.75(-2)=0.50-1.50=-1.00\) unit. 2. \(0.60(-0.10)+0.40(0.05)=-0.06+0.02=-0.04\), a 4-percentage-point lower risk under treatment. 3. No. The untreated mean in that stratum is unavailable, so the contrast cannot be estimated directly; positivity fails for a target-relevant stratum. 4. Not necessarily. The weights define the target population, so different stratum proportions can yield different averages, particularly when the stratum-specific contrasts differ.

Clinical Biostats