Day 59. Counterfactuals & the Ladder of Causation
The top rung: what would have happened to this unit, given what actually happened? Abduction, action and prediction compute counterfactuals from an SCM; probabilities of necessity and sufficiency answer attribution questions, and are only partly identified from data.
- ●Place a question on the ladder of causation (association, intervention, counterfactual).
- ●Compute unit-level counterfactuals with abduction, action and prediction.
- ●Derive and apply the probability of necessity under exogeneity and monotonicity, and bounds on the probability of necessity and sufficiency.
- ●Show that two models can agree on every experiment and still disagree on counterfactuals.
Theory
The ladder of causation
| Rung | Question | Notation | Needs |
|---|---|---|---|
| 1. Association | What do I expect to see if I observe ? | data | |
| 2. Intervention | What happens if I do ? | data + causal graph (or an experiment) | |
| 3. Counterfactual | Given that and happened, what would have been under ? | an SCM (functions, not only a graph) |
Each rung needs more assumptions than the one below.
Counterfactuals in an SCM
For unit (a value of the disturbances ), the counterfactual is the value of in the modified model . These are Phase 3's potential outcomes, now derived from structural equations. Consistency: if then .
Three steps
To compute :
- Abduction: update the disturbances using the evidence: .
- Action: replace 's equation by .
- Prediction: compute in the modified model, using .
Linear models: the same effect for everyone
If (whatever the dependence between and ), then for every unit. Unit-level counterfactuals are easy; they are hard precisely when effects vary across units.
Attribution: necessity and sufficiency
For binary (write for , for ):
- Probability of necessity: : among exposed people who got the disease, the share who would not have without exposure ("but-for" causation in law).
- Probability of sufficiency: .
- Probability of necessity and sufficiency: : the share of units who respond.
Identification under extra assumptions
If is exogenous (randomised) and the effect is monotone (no one is harmed: ), then
Without monotonicity, experiments give only bounds, for example
Part 1 · Warm-up
Exercise 1 · Which rung?
Classify: (a) "Patients who take aspirin have fewer heart attacks." (b) "If we give everyone aspirin, heart attacks will fall by 10%." (c) "Would Mr Lee have avoided his heart attack if he had taken aspirin?" (d) "What share of heart attacks among non-users would aspirin have prevented?"
Show solution
Step 1. (a) Rung 1 (association).
Step 2. (b) Rung 2 (intervention).
Step 3. (c) Rung 3: a counterfactual about a specific person, given what happened.
Step 4. (d) Rung 3: a counterfactual conditioned on observed status (non-users who had attacks).
Exercise 2 · Abduction, action, prediction
. A unit has , . What would have been with ?
Show solution
Step 1. Abduction: .
Step 2. Action: set .
Step 3. Prediction: .
Exercise 3 · Counterfactuals downstream
, , . A unit has , , . Compute and .
Show solution
Step 1. Abduction: ; .
Step 2. Action: .
Step 3. Prediction: ; .
Answer: and .
Exercise 4 · Probability of necessity
In a randomised trial, and . Assuming no one is harmed by the drug, among treated patients who recovered, what share recovered because of the drug?
Show solution
Step 1. .
Answer: 37.5%; the other 62.5% would have recovered anyway.
Exercise 5 · Effect of treatment on the treated
Write the ATT as a counterfactual quantity and say which rung it belongs to.
Show solution
Step 1. , using consistency.
Step 2. conditions a counterfactual on the actual treatment.
Answer: rung 3 in form, though it is identified by the same assumptions as rung-2 quantities (back-door, Exercise 14).
Part 2 · Proofs
Exercise 6 · Consistency from the SCM
Prove that if then .
Show solution
Step 1. differs from only in 's equation.
Step 2. For unit , the original equation already produces , so replacing it with changes no value.
Step 3. All other equations and disturbances are identical, so every variable, including , takes the same value.
Exercise 7 · Linear counterfactuals
Let , with arbitrarily dependent on . Prove .
Show solution
Step 1. Abduction: given , , we know exactly.
Step 2. Action and prediction: .
Step 3. This is non-random given the evidence, so its expectation is itself. (Rung 3 collapses to , a rung-2 quantity, in linear additive models.)
Exercise 8 · Probability of necessity under exogeneity and monotonicity
Assume and . Prove .
Show solution
Step 1. (consistency).
Step 2. By exogeneity, factors out: .
Step 3. Monotonicity: whenever , so .
Step 4. By exogeneity . Substitute.
Exercise 9 · Bounds on PNS
From experimental data alone, prove .
Show solution
Step 1. Four response types: with probabilities ; .
Step 2. Experiments give and .
Step 3. Upper: and .
Step 4. Lower: , and .
Exercise 10 · Same experiments, different counterfactuals
Construct two SCMs for binary with the same for both but different .
Show solution
Step 1. Model A: , . Then for both , and nobody responds: .
Step 2. Model B: (exclusive or). Again for both .
Step 3. In Model B, units with have (helped) and units with have (harmed): .
Answer: identical at rungs 1 and 2, different at rung 3. A zero average effect can hide large offsetting individual effects.
Part 3 · Applied
Exercise 11 · A worker's counterfactual wage
In Day 50's SCM, , a worker has 12 years of schooling and . What would her log wage have been with 16 years? Does the answer depend on her (unobserved) ability?
Show solution
Step 1. Abduction: . We cannot separate from , but we do not need to.
Step 2. Action: . Ability is upstream of schooling, so it is unchanged.
Step 3. Prediction: .
Answer: 2.92, about 38% higher wages (). Her ability does not matter because the model is linear and additive (Exercise 7); with heterogeneous returns it would.
Exercise 12 · But-for causation in court
A worker exposed to asbestos develops mesothelioma and sues. A cohort study (exposure as good as random given the covariates) gives a lifetime risk of 2.0% for exposed and 0.5% for comparable unexposed workers. Assuming asbestos never prevents the disease, is it "more likely than not" that the exposure caused this worker's disease?
Show solution
Step 1. Exogeneity and monotonicity give .
Step 2. Equivalently, and .
Answer: 75% > 50%: the civil standard is met. The rule "RR > 2 implies PN > 0.5" holds under these assumptions; without monotonicity only bounds are available.
Exercise 13 · How many people does a vaccine protect?
A trial finds infection risks of 2% with vaccine and 10% with placebo. Let = "not infected". Bound the share of people who are protected (not infected with the vaccine, infected without), without assuming monotonicity. What does monotonicity add?
Show solution
Step 1. and ; .
Step 2. Lower bound: .
Step 3. Upper bound: .
Step 4. With monotonicity (the vaccine never causes infection), exactly.
Answer: between 8% and 10% of people are protected; at most 2% could be harmed (infected only because vaccinated), which is what widens the interval.
Exercise 14 · Effect of training on the trained
Use Day 52's training data: half previously employed (); training rates 30% () and 70% (); employment : : 0.60 untrained, 0.70 trained; : 0.20 untrained, 0.35 trained. Compute and the ATT.
Show solution
Step 1. Composition of the trained: .
Step 2. With a back-door set, .
Step 3. .
Step 4. .
Answer: training raised the employment of those trained by 13.5 points, slightly more than the ATE of 12.5 points, because the trained are mostly people for whom training helps more.
Exercise 15 · A patient's counterfactual
A patient refused a drug and died. Her family asks whether she would have survived with it. A trial shows survival of 70% with the drug and 60% without. What can be said?
Show solution
Step 1. The question is rung 3: , the probability of sufficiency.
Step 2. Patients who refuse may differ from trial participants (refusal is not random), so even population-level quantities require care.
Step 3. Treating her as exchangeable with trial patients and assuming monotonicity: .
Answer: about a 25% chance she would have survived, under strong assumptions. Without monotonicity, only bounds are available; the honest answer is a range.
Verify in Python
import numpy as np
# Exercise 3: abduction-action-prediction
X, M, Y = 2, 1.5, 4
uM, uY = M - .5 * X, Y - M - X
M0 = .5 * 0 + uM; Y0 = M0 + 0 + uY
print("M_0 =", M0, " Y_0 =", Y0)
# Exercise 11: counterfactual log wage
resid = 2.6 - 1.5 - .08 * 12
print("log W_16 =", round(1.5 + .08 * 16 + resid, 3), " wage gain", f"{np.exp(.32) - 1:.1%}")
# Exercises 4, 12, 13: necessity and sufficiency
PN = lambda p1, p0: (p1 - p0) / p1
print("PN drug:", round(PN(.8, .5), 3), " PN asbestos:", round(PN(.02, .005), 3))
p1, p0 = .98, .90
print("PNS bounds:", (round(max(0, p1 - p0), 3), round(min(p1, 1 - p0), 3)))
# Exercise 10: two models, same experiments, different counterfactuals
rng = np.random.default_rng(59); U = rng.random(1_000_000) < .5
for name, f in [("A: Y = U", lambda x: U), ("B: Y = X xor U", lambda x: np.logical_xor(x, U))]:
Y1, Y0 = f(1), f(0)
print(f"{name:15s} P(Y=1|do1) {Y1.mean():.3f} P(Y=1|do0) {Y0.mean():.3f} PNS {(Y1 & ~Y0).mean():.3f}")
# Exercise 14: ATT
pT = {1: .3, 0: .7}; pE = {(1, 0): .60, (1, 1): .70, (0, 0): .20, (0, 1): .35} # key (z, t)
pz_t1 = {z: .5 * pT[z] / .5 for z in (0, 1)}
EY0_T1 = sum(pE[z, 0] * pz_t1[z] for z in (0, 1)); EY_T1 = sum(pE[z, 1] * pz_t1[z] for z in (0, 1))
print(f"E[E_0|T=1] {EY0_T1:.3f} E[E|T=1] {EY_T1:.3f} ATT {EY_T1 - EY0_T1:.3f}")
Key takeaways
- Rung 3 conditions counterfactuals on what actually happened; computing them takes abduction, action and prediction in an SCM.
- In linear additive models every unit has the same effect; heterogeneity is what makes counterfactuals hard.
- Probabilities of necessity and sufficiency answer attribution questions; they are identified under exogeneity and monotonicity and otherwise bounded.
Simulation Lab: Counterfactuals & Attribution
Open full screen →Abduction, action and prediction for one worker's wage, and bounds on how many people a vaccine actually protects.
Left: abduction, action, prediction in Y := 1.5 + β·S + U. The worker's U is read off her observed point (abduction); then schooling is set to a new value (action) and her own line, parallel to the population line, gives the counterfactual (prediction). Right: from an experiment alone, the share of people who respond (PNS) is only bounded; monotonicity pins it down.