Contents/ Part XXIX · Capstone Projects: Design & Causal Inference/ Chapter 183

Propensity Scores: Matching and Weighting

Capstone 23. Every measured covariate balances to within 0.025 of a standard deviation. The estimate moves by nine percent, and all of what remains is bias. The balance table was not lying; it was answering a different question.

⏱️ ~21 min read
🎯 Causal inference
📊 Chapter 183

The last two capstones designed their own experiments. This one arrives after the fact, with a program that was never randomized and a question that the data may not be able to answer. The work is to find out which.

The brief
Setting
An employer's voluntary management-training program. Four thousand employee records, each with department, education, age, tenure, prior performance rating and prior salary, all recorded before enrollment, plus salary growth over the following 12 months.
The question
Did the training program raise the salary growth of the people who took it?
Why it matters
The program is popular and its budget is up for renewal. A naive comparison makes it look like an unambiguous success, and that comparison is what will be quoted unless somebody does better.
What we do
Fit a propensity model on every pre-enrollment covariate, check common support, match with a caliper, verify balance, cross-check with inverse probability weighting, and then ask the only question that can address what the covariates missed: how strong would an unmeasured confounder have to be?
e(x)
The propensity score is the probability of receiving treatment given the measured covariates. Among people with the same score, treatment is as good as randomly assigned with respect to those covariates. That final clause is not a technicality. It is where every propensity analysis lives or dies.
The finding, up front

The naive difference is +1.83 percentage points. After matching on six pre-enrollment covariates, with every standardized difference under 0.025, it is +1.67. Weighting agrees at +1.65. The true effect of the program is exactly zero, and the variable that explains the whole thing was never in the file.

1

Why This Is Not an Experiment

Nobody was randomized. Employees decided for themselves whether to enroll, which means the two groups differ in every respect that influenced that decision, and only some of those respects were written down. The whole apparatus of this chapter exists to substitute for a randomization that never happened.

The analysis plan was written before the outcome data were linked in. Six covariates, all measured before enrollment, an explicit estimand, a balance target, a cross-check by a second method, and a sensitivity analysis that is stated to be non-optional.

MEASURED COVARIATES department · education · age · tenure prior rating · prior salary adjusted for Enrolled Salary growth ambition not in the file the effect we want · true value: zero the two red arrows are what matching cannot see
Two paths into the outcome, and only one of them is adjustable. The gray arrows run through variables the HR system recorded, so matching closes them. The red arrows run through something nobody wrote down, and no amount of care with the gray box touches them.
2

Cleaning, and the Naive Comparison

StepRowsWhat happened
HR export4,055The extract ran twice
After deduplication4,000One row per employee
Complete cases3,88090 with no prior rating on file, 30 with a tenure of −1, which is a sentinel and not a tenure

Complete-case analysis is a decision, not a default. Dropping 120 employees is defensible only if the reason their records are incomplete is unrelated to their salary growth, which is an assumption nobody has tested. It is disclosed here rather than solved; Capstone 31 takes it up properly.

Enrolled
4.49%
n = 1,247
Not enrolled
2.66%
n = 2,633
Difference
+1.83 pp
95% CI [+1.68, +1.98]
Reading
Not yet
these are different people
Left: a grouped bar chart of performance rating the year before, from 1 to 5, for the two groups. More of those who did not enroll are rated 2 and 3, more of those who enrolled are rated 4 and 5. Right: a horizontal bar chart of the share of each department that enrolled, from 28.1 percent in Support to 36.4 percent in Sales, with a dotted line at the company-wide rate of 32.1 percent.
Left: the two groups were rated differently before anybody enrolled in anything. Right: and they were not drawn evenly from the business either. Both panels describe selection on things the company wrote down, which is the half this design can handle.
3

The Propensity Score, and Common Support

A logistic regression of enrollment on the six covariates gives each employee a probability of enrolling. Before anything is matched, the two distributions have to be compared, because anyone whose score falls outside the range covered by the other group has no counterpart in the data at all.

Score, enrolled
0.10 to 0.64
mean 0.348
Score, not enrolled
0.08 to 0.64
mean 0.309
Off common support
5
of 3,880 employees
Overlap
Excellent
not the problem here

Good overlap is itself a finding worth reporting: enrollment was not concentrated in some corner of the workforce that nobody else occupies. Five employees have no comparable counterpart and are dropped. In many observational studies this step removes a substantial fraction of the sample and quietly changes who the estimate is about, which is why the number belongs in the write-up whether it is five or five hundred.

4

Matching, and a Balance Table That Passes

One-to-one nearest neighbor on the logit of the score, without replacement, with a caliper of 0.2 standard deviations. A treated employee with no control inside the caliper is left unmatched rather than paired with somebody who is not really similar: 1,220 pairs from 1,247 enrolled employees, with 27 discarded.

CovariateSMD beforeSMD after
Prior performance rating+0.285+0.012
Education, postgraduate+0.167−0.019
Tenure, years−0.158−0.003
Education, high school−0.157+0.015
Department, Sales+0.109−0.013
Department, Operations−0.107+0.016
Age−0.081+0.025
Prior salary+0.011−0.012

The largest remaining standardized difference is 0.025, against a conventional target of 0.10. This is what a successful match looks like, and in most published work it is the exhibit offered as evidence that the comparison is now fair.

Left: overlaid histograms of the propensity score for enrolled and not-enrolled employees, almost entirely overlapping, with dashed lines marking the common support boundaries at 0.10 and 0.64. Right: a balance plot of standardized mean differences. Open circles show values before matching, spread between minus 0.16 and plus 0.29. Filled circles show values after matching, all within a shaded target band from minus 0.1 to plus 0.1. A red diamond at the bottom, labeled ambition not measured, sits at plus 1.06, far outside the plot's other points.
Left: the scores overlap almost completely, so common support is not the difficulty. Right: the balance plot that goes in the appendix. Every measured covariate lands inside the target band. The red diamond is the variable nobody measured.
5

Two Methods, One Answer, and Barely Any Movement

Naive
+1.83 pp
no adjustment
Matched
+1.67 pp
SE 0.09, CI [+1.49, +1.84]
Weighted (IPTW)
+1.65 pp
same covariates, ATT weights
Adjustment moved it
9%
of the naive difference

Two different adjustment methods agreeing closely is genuinely reassuring, and it is reassuring about the arithmetic rather than about the assumption. Matching and weighting use the same six covariates, so they are confounded by anything those covariates miss, and they are confounded by it in the same direction and to the same degree. Agreement between two methods that share an assumption is not evidence for the assumption.

The more uncomfortable number is that adjustment moved the estimate by nine percent. On a well-behaved observational study you might expect the covariates to absorb most of the confounding. Here they absorbed almost none of it, which is a signal about what the covariates are, not about how carefully the matching was done.

6

How Strong Would a Missing Confounder Have to Be?

This is the step that gets skipped, and it is the only one capable of saying anything about what the covariates did not capture. The E-value is the smallest association an unmeasured confounder would need with both enrollment and salary growth, over and above the measured covariates, to account for the whole estimate.

Standardized effect
d = 0.745
matched sample
Approximate risk ratio
1.97
VanderWeele and Ding
E-value
3.35
on both associations
Verdict
Sounds safe
and is the trap

In much of the applied literature an E-value above 2 is presented as evidence of robustness, and 3.35 would pass without comment. But look carefully at what the E-value says. It tells you how strong a confounder would have to be. It cannot tell you whether one exists, and nothing in the data can, because the data do not contain it.

So the question to put to the client is not a statistical one. Is there some characteristic of an employee, not on our list, that makes them both substantially likelier to sign up for management training and substantially likelier to get a raise? Anyone who has worked in an organization can answer that in about a second, and their answer is worth more than the E-value.

Reading a sensitivity surface

The contour is easier to act on than a single number. Suppose an unmeasured characteristic differs between the groups by δ standard deviations and is worth γ percentage points of salary growth per standard deviation. The estimate falls to zero wherever δ × γ reaches 1.67. A variable worth 1.2 points per standard deviation needs a gap of 1.39 SD; one worth 1.75 points needs a gap of 0.95. Both are entirely ordinary sizes for a workplace characteristic, which is the honest conclusion of the analysis before anyone looks at the answer.

7

The Sheet That Was Never Available

The workbook carries a second sheet holding an index of how hard each employee was pushing for advancement. It was never in the HR system and no analyst could have used it. We can, because this is a book.

Ambition, enrolled
+0.601
matched sample
Ambition, not enrolled
−0.347
matched sample
Standardized difference
+1.06
forty times the worst measured one
Effect with it in
+0.02 pp
p = 0.70. True value: zero

The program does nothing, and it never did. The +1.83 was selection from start to finish, and matching on six carefully chosen pre-treatment covariates removed nine percent of it. The balance table was not misleading anybody: those covariates really were balanced. They were simply not the ones that mattered.

Left: a contour surface with the effect of an unmeasured variable on growth in percentage points per standard deviation on the horizontal axis and the gap between the groups in standard deviations on the vertical axis. A dark curve marks where the adjusted estimate reaches zero, and a yellow star marks the position of the ambition variable, sitting on that curve. Right: five bars of the estimated effect, naive at 1.83, matched at 1.67, IPTW at 1.65, adding ambition at 0.02, and the truth at zero.
Left: every combination of confounder strength that would drive the estimate to zero lies above the dark curve, and the star is where the real variable turned out to sit. The sensitivity analysis could not tell you the star exists; it told you exactly how big it would have to be. Right: the chapter in five bars.

Notice the order in which that was done. The sensitivity analysis was computed before the reveal, and it gave the correct warning: a confounder of entirely ordinary size would flatten this estimate. Had the analysis stopped at the balance table, the report would have said the program raises salary growth by 1.7 points, and the balance table would have been the proof.

8

What Propensity Methods Do and Do Not Do

They doThey do not
Remove confounding carried by the covariates you haveRemove confounding carried by anything else
Make the comparison transparent, with a balance table anyone can checkMake the comparison valid
Reveal where the two groups do not overlap at allTell you whether the overlap you have is on the right variables
Separate the design stage from the outcome stage, so balance is checked before results are seenSubstitute for randomization
Give a defensible estimate when the covariates really are the whole storyTell you whether they are

None of that makes the method a bad one. The propensity model in this chapter did its job correctly and the matching was sound. What failed was the assumption of no unmeasured confounding, which is untestable by construction, and which every observational causal claim rests on whether or not it is stated. The contribution of a careful analysis is to make that dependence visible and to price it, which is what the sensitivity analysis did.

9

What to Watch

10

Propensity Methods in Data Science & AI

Where it appearsThe same assumption, in a different costume
Marketing attributionComparing exposed and unexposed users on observed features, where the thing that drove exposure was intent
Uplift and heterogeneous effectsCausal forests and meta-learners estimate who benefits most, and inherit unconfoundedness whole
Off-policy evaluationInverse propensity scoring of a logged bandit policy, where the propensities are known rather than estimated, which is the rare good case
Observational model monitoringComparing outcomes for users who did and did not receive a model's recommendation
Algorithmic fairness auditingAdjusting for measured covariates to ask whether a disparity is explained, where the unmeasured ones are usually the argument
Where the research went

The propensity score comes from Rosenbaum and Rubin in 1983, and Rosenbaum's own sensitivity bounds arrived alongside it, which says something about how central the concern always was. The modern alternatives are worth knowing. Doubly robust estimators combine a propensity model with an outcome model and remain consistent if either is right, which helps with misspecification and not at all with a missing variable. Targeted maximum likelihood and double machine learning let flexible learners estimate both stages while preserving valid inference. Every one of them assumes no unmeasured confounding. The methods of the next chapter do not, which is why they exist.

🐍

The full project, step by step

The companion notebook reads the analysis plan before the outcomes, cleans the export and reports what it discards, fits the propensity model, trims to common support, implements caliper matching without replacement from scratch, builds the balance table, cross-checks with ATT weighting, computes an E-value and a two-dimensional sensitivity surface, and only then joins the sheet that shows the entire estimate was selection.

📓 View Notebook (code & outputs) ▶ Open in Colab ⬇ View / Download on GitHub
Read the reports & get the data

The dataset (capstone-propensity-score-matching.xlsx) holds 4,055 HR records with their duplicates, missing ratings and tenure sentinels intact, the analysis plan written before the outcomes were linked, and a separate sheet carrying the variable that was never observed. Two written reports accompany it: a plain-language brief for the HR director whose budget depends on the answer, and a technical report covering the propensity model, the balance diagnostics and the sensitivity analysis.

🎓 Key Takeaways

  • Matching balances the covariates you have. Every measured one landed inside 0.025 SD, and the unmeasured one was still separated by 1.06.
  • Adjustment moved the estimate by nine percent. The covariates carried almost none of the confounding, which is a fact about the covariates, not about the method.
  • Two methods agreeing is one piece of evidence. Matching and weighting share an assumption and fail together.
  • The E-value says how strong, never whether. A value of 3.35 read as reassuring, and the missing variable cleared it easily.
  • The program's true effect was zero. A textbook-clean analysis reported +1.67 points, and the sensitivity analysis was the only part of it that gave the right warning.

Quiz: Test Yourself