Day 43. The Propensity Score Theorem
One number, the probability of treatment given covariates, is enough to remove all confounding by those covariates. Why it works and how to use it.
- ●Prove the balancing property of the propensity score and the Rosenbaum–Rubin theorem.
- ●Estimate propensity scores by logit and check covariate balance within propensity strata.
- ●Use subclassification on the propensity score to estimate ATE and ATT.
- ●Explain what the propensity score can and cannot do (it does not fix unobserved confounding).
Theory
The problem of many covariates
With many covariates, exact matching on is impossible: almost every unit has a unique covariate combination. Rosenbaum & Rubin (1983) showed that a single summary suffices.
Two results
The propensity score is .
- Balancing property: . Among units with the same propensity score, the distribution of covariates is the same for treated and controls.
- Propensity score theorem: if , then .
So instead of adjusting for a vector , it is enough to adjust for the scalar : match, stratify or weight on it.
Using it in practice
- Estimate , typically by logit (Day 11) with flexible terms (interactions, squares) or machine learning.
- Check overlap (Day 42) and trim if needed.
- Check balance: within propensity strata (or after weighting), normalised differences of each covariate should be small. Balance is the diagnostic for whether the score model is good enough, not its fit or its .
- Estimate effects: subclassification (5 strata typically remove about 90% of the bias from a single covariate, Cochran 1968), matching (Day 81), or weighting (Day 44).
What it cannot do
The propensity score only balances the covariates used to build it. It is a tool for implementing unconfoundedness, not a substitute for it.
Part 1 · Warm-up
Exercise 1 · A propensity score from a logit
A logit for enrolling in a training programme has . Compute for a 30-year-old unemployed worker.
Show solution
Step 1. Index: .
Step 2. .
Answer: an 18% chance of enrolling.
Exercise 2 · Same score, different covariates
A 25-year-old employed worker has index . Compare with Exercise 1. What does the balancing property say about such pairs?
Show solution
Step 1. Both workers have the same index, hence .
Step 2. They differ in age and employment, but are equally likely to enrol.
Answer: among units with , the mix of (age, employment) profiles is the same for enrollees and non-enrollees, so comparing them does not confound the effect with these covariates.
Exercise 3 · Subclassification estimate
Five propensity strata of equal size have within-stratum treated-minus-control differences in earnings ($1,000) of 0.5, 1.0, 1.5, 1.2, 2.0. Estimate the ATE.
Show solution
Step 1. Equal stratum sizes give equal weights of 1/5.
Step 2. ATE .
Answer: about $1,240.
Exercise 4 · ATT by subclassification
In Exercise 3, the strata contain 5%, 10%, 20%, 25% and 40% of all treated units. Estimate the ATT.
Show solution
Step 1. Weight strata by their share of treated units.
Step 2. ATT .
Step 3. .
Answer: about $1,525: the treated sit mostly in high-propensity strata, where effects are larger.
Exercise 5 · Balance within a stratum
In one propensity stratum, treated workers average 11.2 years of schooling (sd 2.5) and controls 10.9 (sd 2.4). Compute the normalised difference. Is balance acceptable?
Show solution
Step 1. Pooled sd: .
Step 2. .
Answer: 0.12 < 0.25: acceptable. Check every covariate in every stratum.
Part 2 · Proofs
Exercise 6 · The balancing property
Prove , i.e. .
Show solution
Step 1. is a function of , so conditioning on is conditioning on : .
Step 2. LIE: .
Step 3. Both equal , so knowing beyond does not change the treatment probability: .
Exercise 7 · The propensity score theorem
Assume . Prove , i.e. unconfoundedness given .
Show solution
Write .
Step 1. LIE: (conditioning on refines conditioning on ).
Step 2. Unconfoundedness given : .
Step 3. So .
Step 4. This does not depend on , so .
Exercise 8 · Adjusting for the score identifies the ATE
Using Exercise 7, show .
Show solution
Step 1. Apply Day 42, Exercise 6 with playing the role of : unconfoundedness holds given (Exercise 7), and overlap holds by assumption.
Step 2. So for ; subtract.
Exercise 9 · Any balancing score works
A balancing score is any with . Show that itself is a balancing score, and that is the coarsest one (it is a function of every balancing score).
Show solution
Step 1. Given , is fixed, so trivially independent of : is a balancing score (the finest).
Step 2. If is balancing, then , using the balancing property in the last step.
Step 3. So can be computed from : it is a function of every balancing score.
The propensity score achieves the maximum dimension reduction.
Exercise 10 · The propensity score does not fix hidden bias
Suppose depends on and an unobserved that also affects . Explain why adjusting for does not remove confounding by .
Show solution
Step 1. Exercise 7 needed unconfoundedness given ; here it fails because of .
Step 2. Within a stratum of , treated units still have different (hence different ) than controls.
Answer: the propensity score balances only what goes into it. Good balance on says nothing about .
Part 3 · Applied
Exercise 11 · Subclassification in a training study
A training study estimates propensity scores and forms five strata. Within strata the effects and sizes are:
| Stratum | Treated | Controls | Effect ($1,000) |
|---|---|---|---|
| 1 | 5 | 395 | 0.4 |
| 2 | 10 | 190 | 0.8 |
| 3 | 20 | 80 | 1.2 |
| 4 | 40 | 40 | 1.6 |
| 5 | 60 | 15 | 2.0 |
Estimate the ATE and the ATT.
Show solution
Step 1. Stratum sizes: 400, 200, 100, 80, 75; total 855. Treated: 135.
Step 2. ATE weights : .
Step 3. ATT weights : .
Answer: ATE ≈ $840, ATT ≈ $1,610: the treated are concentrated where effects are large. Stratum 1's 5 treated and stratum 5's 15 controls signal thin overlap at the extremes.
Exercise 12 · Checking the score model
After subclassification, baseline earnings are balanced in four strata but in stratum 5 treated workers earn $3,000 more (normalised difference 0.6). What should the analyst do?
Show solution
Step 1. Imbalance means the score model does not capture how earnings relate to treatment at high propensities.
Step 2. Re-specify: add earnings squared, interactions (earnings × unemployed), or split stratum 5.
Step 3. Re-check balance; iterate. Do not look at outcomes while doing this, so the model is chosen for balance, not for the answer.
Answer: refine the propensity model until balance is achieved, blind to outcomes.
Exercise 13 · Smoking and birth weight
A study of maternal smoking and birth weight uses a propensity score based on age, education, parity and prenatal visits. Name a plausible unobserved confounder and the likely direction of bias.
Show solution
Step 1. Candidates: alcohol use, diet, stress, or partner's smoking: correlated with smoking and harmful to the baby.
Step 2. These make smokers' babies lighter even apart from smoking, so the estimated harm of smoking is overstated (biased away from zero).
Answer: e.g. alcohol use; the propensity score cannot fix it, but a sensitivity analysis can show how strong it would need to be.
Exercise 14 · Many covariates, few treated
A hospital study has 80 treated patients and 60 candidate covariates. Why can a saturated logit for the propensity score be a problem, and what are the alternatives?
Show solution
Step 1. With 60 covariates and 80 treated, the logit overfits: estimated scores pile up near 0 and 1, sometimes with perfect separation (Day 25).
Step 2. Overfitted scores exaggerate apparent non-overlap and produce extreme weights.
Step 3. Alternatives: choose covariates by subject-matter knowledge (those affecting both treatment and outcome), penalised logit (ridge or lasso), or methods that target balance directly (entropy balancing, Day 84).
Answer: a propensity model is a means to balance, not a prediction contest.
Exercise 15 · Is a high-AUC propensity model good news?
A propensity model predicts enrolment in a job-search programme almost perfectly (area under the ROC curve 0.98). Is that good or bad for estimating the programme's effect?
Show solution
Step 1. Near-perfect prediction means scores close to 0 or 1 for most units.
Step 2. That signals poor overlap: few comparable treated and control units.
Answer: bad. Unlike in prediction tasks, a highly accurate propensity model warns that causal comparisons will rely on few units or on extrapolation.
Verify in Python
import numpy as np
from scipy import optimize
rng = np.random.default_rng(43)
n = 20_000
age = rng.normal(35, 10, n); unemp = rng.random(n) < 0.4
X = np.column_stack([np.ones(n), age, unemp])
T = rng.random(n) < 1 / (1 + np.exp(-(1.0 - 0.06 * age + 1.0 * unemp)))
y0 = 20 + 0.3 * age - 5 * unemp + rng.normal(0, 4, n)
y1 = y0 + 1 + 2 * unemp # effect larger for the unemployed
y = np.where(T, y1, y0)
nll = lambda b: -np.sum(T * (X @ b) - np.log1p(np.exp(X @ b)))
b = optimize.minimize(nll, np.zeros(3)).x
e = 1 / (1 + np.exp(-X @ b))
strata = np.digitize(e, np.quantile(e, [0.2, 0.4, 0.6, 0.8]))
ate = sum((strata == s).mean() * (y[T & (strata == s)].mean() - y[~T & (strata == s)].mean()) for s in range(5))
att = sum((T & (strata == s)).sum() / T.sum() * (y[T & (strata == s)].mean() - y[~T & (strata == s)].mean()) for s in range(5))
# five strata remove most, but not all, of the confounding bias
print(f"naive {y[T].mean() - y[~T].mean():.2f}; subclassification ATE {ate:.2f} (truth {(y1 - y0).mean():.2f}), "
f"ATT {att:.2f} (truth {(y1 - y0)[T].mean():.2f})")
for name, v in (("age", age), ("unemployed", unemp.astype(float))):
nd = [(v[T & (strata == s)].mean() - v[~T & (strata == s)].mean()) / v.std() for s in range(5)]
print(f"normalised differences within strata, {name}:", np.round(nd, 2))
print("Exercise 11: ATE", round(718 / 855, 3), " ATT", round(218 / 135, 3))
Key takeaways
- Conditional on the propensity score, covariates are balanced between treated and controls.
- If treatment is unconfounded given X, it is unconfounded given e(X): one number replaces many covariates.
- Judge a propensity model by the balance it achieves, never by its predictive accuracy; it cannot fix unobserved confounding.
Simulation Lab: Balancing on the Propensity Score
Open full screen →Stratify on the estimated score: covariate imbalance vanishes within strata and the bias with it.
A health programme targeted at older, lower-income adults. Balancing theorem: within groups of similar propensity score, treated and untreated have the same covariate distribution. Bars show normalised differences — huge overall, small within strata. True effect +2.