Day 34. The Fundamental Problem & Selection Bias
Why naive comparisons fail. Decomposing them into the ATE, selection bias and heterogeneity bias, and the Roy model of people choosing treatment.
- ●Decompose a naive comparison into ATE + selection bias + heterogeneity bias.
- ●Use the Roy model to explain selection on levels versus selection on gains.
- ●Predict the sign of selection bias in common economic and health settings.
- ●Recognise Ashenfelter's dip and why before–after comparisons mislead.
Theory
Two decompositions
With (Day 31) and :
- Selection bias (selection on levels): the treated would have had different outcomes even untreated.
- Heterogeneity bias (selection on gains): the treated benefit more or less than the untreated.
Randomisation sets both to zero (Day 35).
The Roy model
Roy (1951) asked how workers choose occupations. Applied to programmes: unit chooses treatment if its gain exceeds its cost,
Choice now depends on potential outcomes, the opposite of an experiment. Two typical patterns:
- Positive selection on gains: those who gain most enrol, so ATT > ATE > ATC.
- Negative selection on levels: programmes target, or attract, people with poor prospects: , so naive comparisons understate effects (training for the unemployed, hospital care for the sick).
If gains are normal, , and , then
Ashenfelter's dip
Trainees' earnings often fall just before they enrol (they enrol because they lost a job). A before–after comparison then credits the programme with the natural recovery (Ashenfelter, 1978).
Part 1 · Warm-up
A programme has ATT = 2, ATC = 1, 40% of the population treated, and selection bias −3 (all in $1,000 of earnings).
Exercise 1 · ATE
Compute the ATE.
Show solution
Step 1. ATE (Day 33).
Step 2. .
Answer: $1,400.
Exercise 2 · The naive comparison
What does the naive comparison report?
Show solution
Step 1. Naive ATT selection bias .
Answer: −1: the programme looks harmful.
Exercise 3 · Three-term check
Verify the three-term decomposition.
Show solution
Step 1. Heterogeneity bias .
Step 2. ATE SB HB . ✓
Exercise 4 · Sign of selection bias
For each, predict the sign of : (a) earnings, for a programme for displaced workers; (b) health, for people who choose to take vitamins; (c) test scores, for pupils whose parents pay for tutoring.
Show solution
Step 1. (a) Displaced workers would earn less anyway: negative.
Step 2. (b) Vitamin takers tend to be healthier and wealthier: positive.
Step 3. (c) Families who pay for tutoring are richer and more engaged: positive (unless tutoring is bought for struggling pupils: then negative).
Exercise 5 · The Roy rule
Workers enrol if . Worker A has , ; worker B has , . Who enrols?
Show solution
Step 1. A's gain : enrols.
Step 2. B's gain : does not.
Answer: A enrols. Note that A also has lower : here selection on gains and negative selection on levels go together.
Part 2 · Proofs
Exercise 6 · The two-term decomposition
Prove naive ATT selection bias.
Show solution
Step 1. Observed outcomes: and .
Step 2. Add and subtract :
Step 3. The first bracket is the ATT; the second is the selection bias.
Exercise 7 · The three-term decomposition
Prove ATT ATE , and hence the three-term decomposition.
Show solution
Step 1. From ATE : .
Step 2. Substitute ATT ATE into Exercise 6.
Exercise 8 · Randomisation kills both biases
Prove that if is independent of , selection bias and heterogeneity bias are both zero.
Show solution
Step 1. Independence of and : , so selection bias .
Step 2. Independence of and : ATT ATC ATE, so heterogeneity bias .
Step 3. Hence naive ATE.
Exercise 9 · Selection on gains raises the ATT
In the Roy model with (and ), prove ATT ATE ATC.
Show solution
Step 1. Every treated unit has , so ATT .
Step 2. Every untreated unit has , so ATC .
Step 3. So ATT ATC, and ATE lies between them.
Exercise 10 · The Roy ATT with normal gains
If and , prove ATT .
Show solution
Step 1. Standardise: , and .
Step 2. Truncated-normal mean: with .
Step 3. By symmetry, and .
Step 4. ATT .
Part 3 · Applied
Exercise 11 · Roy model for a training programme
Gains from training (in $1,000) are normally distributed with mean 2 and sd 3 across workers, and workers enrol only if they gain. Compute the share who enrol, the ATT and the ATE.
Show solution
Step 1. Share enrolling: .
Step 2. .
Step 3. ATT .
Step 4. ATE .
Answer: 75% enrol; ATT ≈ $3,280 versus ATE $2,000. An evaluation of current trainees overstates what compulsory training would achieve.
Exercise 12 · Ashenfelter's dip
Trainees usually earn $15k a year. In the year before training, after losing jobs, they earn $12k. After training they earn $16k. Without training, their earnings would have recovered to $15k. Compare the before–after estimate with the true effect.
Show solution
Step 1. Before–after: .
Step 2. True effect: .
Step 3. The extra 3 is the recovery from the dip (mean reversion) that would have happened anyway.
Answer: before–after says $4k; the truth is $1k. Comparing with a pre-dip baseline or with a matched control group that also lost jobs avoids this.
Exercise 13 · Do hospitals harm health?
In a health survey, people admitted to hospital last year report worse health (3.2 on a 1–5 scale, 5 = excellent) than those not admitted (3.9). Decompose the naive difference if hospital care truly raises health by 0.3 for those admitted.
Show solution
Step 1. Naive .
Step 2. Naive ATT selection bias, with ATT .
Step 3. Selection bias .
Answer: admitted patients would have reported health a full point lower without care; the sick go to hospital. The naive comparison makes beneficial care look harmful.
Exercise 14 · The college wage premium
College graduates earn 60% more than high-school graduates (in logs, 0.47). A twins study suggests ability and family background account for 0.15 log points. Decompose the raw gap.
Show solution
Step 1. Raw gap = ATT selection bias, with selection bias (graduates would have earned more anyway).
Step 2. ATT , i.e. .
Answer: about two-thirds of the raw premium is a causal return for graduates; one-third is selection. If gains are heterogeneous, the effect for non-graduates (ATC) may be smaller still.
Exercise 15 · Which direction?
A city opens a free clinic, and clinic users have lower blood pressure than non-users. An analyst concludes the clinic works. List the threats using the decomposition, and propose a design that avoids them.
Show solution
Step 1. Selection on levels: health-conscious people use clinics and would have lower blood pressure anyway (positive bias in the naive "effect", i.e. too good).
Step 2. Selection on levels the other way: people with symptoms seek care (negative bias). The net sign is unknown.
Step 3. Selection on gains: those who expect to benefit attend, so even an unbiased ATT would overstate the ATE of universal access.
Step 4. Design: randomise invitations or outreach (an encouragement design, Day 41), or exploit a clinic opening date that varies across neighbourhoods (difference-in-differences, Phase 5).
Answer: the naive comparison mixes the clinic's effect with who chooses to attend; randomised encouragement isolates it.
Verify in Python
import numpy as np
from scipy import stats
# Roy model with normal gains (Exercise 11)
mu, sd = 2.0, 3.0
p = stats.norm.cdf(mu / sd)
att = mu + sd * stats.norm.pdf(mu / sd) / p
print(f"share enrolling {p:.3f}, ATT {att:.3f}, ATE {mu}")
rng = np.random.default_rng(34)
n = 1_000_000
y0 = rng.normal(20, 5, n)
tau = rng.normal(mu, sd, n)
T = tau > 0 # select on gains only
y = y0 + T * tau
naive = y[T].mean() - y[~T].mean()
sb = y0[T].mean() - y0[~T].mean()
att_s, atc_s = tau[T].mean(), tau[~T].mean()
print(f"simulated ATT {att_s:.3f}, ATC {atc_s:.3f}, ATE {tau.mean():.3f}")
print(f"naive {naive:.3f} = ATE {tau.mean():.3f} + SB {sb:.3f} + HB {(1 - T.mean()) * (att_s - atc_s):.3f}")
Key takeaways
- Naive comparison = ATE + selection bias + heterogeneity bias.
- In the Roy model people select on gains, so ATT > ATE > ATC; programmes for the disadvantaged also select on levels.
- Before–after comparisons are vulnerable to Ashenfelter's dip and mean reversion.
Simulation Lab: The Roy Model of Self-Selection
Open full screen →Workers enrol when their gain beats the cost: decompose the naive gap into ATE, selection bias and heterogeneity bias.
Each dot is a worker: earnings without training (Y0) against the gain from training. Workers enrol when the gain exceeds the cost (dashed line). The naive comparison = ATE + selection bias (enrollees' Y0 differs) + heterogeneity bias (enrollees gain more).