Inverse-Probability Weighting and Doubly-Robust Estimation
In Lesson 1 you fixed a confounded comparison by matching: pair each treated patient with an untreated look-alike on their propensity score, then compare only fair matches. It worked, the naive 52-metre headline dissolved back to the real 25. But matching is wasteful. It throws away every control who fails to find a partner, and it stumbles when a treated patient has no close twin at all.
We are still with the cardiac-rehab study from Lesson 1: 400 heart-attack patients, some enrolled in an optional rehab program and some did not, and the outcome is how much further each could walk in six minutes three months later. Fitter patients were both more likely to enroll AND more likely to recover on their own, so the raw gap between enrollees and non-enrollees, 52 metres, badly overstates the 25-metre effect we actually built into the data.
This lesson gives you two sharper tools and then fuses them. First, inverse-probability weighting: instead of discarding controls, reweight every patient so the treated and untreated groups look alike, no data left behind. Then the doubly-robust estimator, which combines weighting with a second model so that you only have to get ONE of the two right. Toggle the panel below: it is the same overlap picture from Lesson 1, treated patients piled at high propensity scores, controls at low. Weighting operates on exactly this picture.
By the end of this lesson you will be able to:
- Reweight the sample by inverse propensity to rebuild a pseudo-randomized population, and compute the effect
- Read the weights to judge whether the estimate can be trusted, and state the positivity (overlap) requirement
- Estimate the same effect a second way, by modelling the outcome, and see why each single method fails if its model is wrong
- Combine both into the doubly-robust (AIPW) estimator and watch it stay correct when either model, but not both, is misspecified
Prerequisites: Lesson 1 (the propensity score, confounding, potential outcomes, and the average treatment effect); you can fit glm and lm, read their predict outputs, and you know what a weighted average is.
Reweight the sample instead of throwing data away
Matching's instinct was to find, for each treated patient, one control who looks like them, and ignore the rest. Weighting keeps a different instinct: keep everyone, but turn the volume up on the units that are under-represented and down on the ones that are over-represented, until the two groups balance.
The dial is the propensity score \(e(x)\) from Lesson 1, the probability a patient with covariates \(x\) enrolls. Give every patient a weight equal to one divided by the probability of the treatment they actually received. A treated patient gets \(1/e(x)\); a control gets \(1/(1-e(x))\):
\[ w_i = \frac{T_i}{e(x_i)} + \frac{1-T_i}{1-e(x_i)}, \]
where \(T_i = 1\) if patient \(i\) enrolled and \(0\) if not. Why one-over-probability? Picture a very fit patient. Fit patients almost all enroll, so a fit patient who did NOT is a rare bird. That single unusual control has to stand in for all the fit controls the data is short of, so weighting counts them several times over. A few concrete patients from our study make it tangible:
| Patient | Baseline | Enrolled? | Propensity \(e(x)\) | Weight |
|---|---|---|---|---|
| 1 | 419 m | no | 0.76 | 4.12 |
| 2 | 383 m | yes | 0.64 | 1.56 |
| 5 | 431 m | yes | 0.79 | 1.27 |
Patient 1 was very fit (419 m), had a 76% chance of enrolling, but did not. As a control that makes them precious: their weight is one over their chance of NOT enrolling (about one in four), which works out to 4.12, so they count for about four ordinary controls. Patient 2 enrolled with a middling 64% chance, a fairly typical enrollee, so their weight \(1/0.64 = 1.56\) is close to one.