ML Systems Lab Open interactive version →
Intermediate 32 min read matchingpropensity scoreIPWdoubly robustobservational studies

Observational Causal Inference

Propensity score matching, IPW, doubly robust estimators, covariate balance

You want to know if a job training program increases earnings. You cannot randomize — people self-select into the program. People who join are more motivated, have higher baseline earnings, and are younger. A simple comparison of treated versus untreated overstates the program's effect because the treated group would have earned more anyway. Observational causal inference tries to recover the treatment effect without randomization, by making treated and control groups comparable using measured covariates.

Matching finds treated units and control units with identical or similar covariate profiles. Match on observed confounders — age, education, income, location — and the matched comparison removes their confounding. Propensity score matching compresses this into one dimension: the propensity score e(X) = P(T=1 | X=x) is a balancing score. Matching on e(X) balances all observed covariates simultaneously (Rosenbaum-Rubin theorem). Estimate e(X) with logistic regression, then match on the estimated scores and verify balance. Concretely: suppose the fitted model gives a 45-year-old non-participant and a 45-year-old participant with the same education and prior earnings the same estimated e(X) = 0.20 — that shared score is what makes the pair a valid match. Before matching, the treated group's mean age is 29 and the control group's is 34, with a pooled standard deviation of 8, so SMD = (29 − 34) / 8 = −0.63 — badly imbalanced. After matching on e(X), the treated mean age is 30.1 and the matched-control mean is 30.4, so SMD = (30.1 − 30.4) / 8 = −0.04, comfortably under the 0.1 threshold used later in this module.

Weighting is the continuous analog. Inverse Probability Weighting (IPW) weights each treated unit by 1/e(X) and each control unit by 1/(1−e(X)), creating a pseudo-population where treatment is uncorrelated with covariates. Take that same e(X) = 0.20: a control unit's weight is 1/(1 − 0.20) = 1.25, while a treated unit's weight is 1/0.20 = 5 — five times the pull of a typical unit. Push e(X) toward 0 or 1 and this ratio explodes, which is exactly why near-certain propensity scores produce the extreme weights (into the hundreds) that can dominate an IPW estimate. Doubly robust estimators (AIPW) combine regression adjustment with IPW and are consistent if either the outcome model or propensity model is correctly specified — not necessarily both. One wrong model is survivable; both wrong is not.

Common support is the region where both treated and control units exist with nonzero probability. Outside common support, inference requires extrapolation. Trim the sample to the region of common support before analysis and report what was trimmed.

What observational methods cannot do: remove confounding from unmeasured covariates. PSM, IPW, and AIPW are unbiased only if ignorability holds — only if all common causes of treatment and outcome are in X. An unmeasured confounder like motivation biases the estimate regardless of how sophisticated the estimator. No amount of covariate adjustment compensates for a variable you did not measure. The best observational studies acknowledge this explicitly and conduct sensitivity analysis for the residual unmeasured confounding — for example, computing the E-value: the minimum strength (on the risk-ratio scale) an unmeasured confounder like motivation would need, above and beyond the measured covariates, to fully explain away the observed effect. A large E-value means an unmeasured confounder that strong is implausible; a small one means the result could easily be an artifact of exactly the confounder the critic named.

Key points

Takeaway

Observational methods buy you exactly one thing: removal of bias from confounders you measured — no estimator, however sophisticated, removes bias from a variable you did not measure.

Recap

Check your understanding

Q1. After PSM, you check covariate balance and find SMD=0.35 for age. What does this mean and what do you do?

Q2. You estimate ATE using IPW. 5 control observations have weights above 500 while all others are below 20. Select the two true statements about the problem and its fix.

Q3. What does 'doubly robust' mean in the AIPW estimator? If both models are misspecified, is the estimate still valid?

Q4. You are studying the effect of a job training program on earnings. Treated individuals self-selected. You find positive earnings effect. A critic says 'there is likely an unmeasured motivation confounder.' How do you respond?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →