Math for Causal Inference

Day 33. Estimands: ATE, ATT, ATC & CATE

Which average effect answers which policy question, how the averages relate, and why the distribution of effects is mostly out of reach.

Video coming soon
Learning outcomes
  • ●Define and compute ATE, ATT, ATC and CATE, and link them with the law of iterated expectations.
  • ●Prove ATE = p·ATT + (1 − p)·ATC and state when ATT = ATE.
  • ●Match estimands to policy questions (keep, expand, target a programme).
  • ●Distinguish quantile treatment effects from quantiles of individual effects, and relative from absolute effects.
2-HOUR SESSION PLAN
Theory 25′Warm-up (1–5) 20′Proofs (6–10) 35′Applied (11–15) 25′Python & Lab 15′
Colab notebook (.ipynb) Jump to the simulator

Theory

The main averages

With τi=Yi(1)−Yi(0)\tau_i = Y_i(1) - Y_i(0) and covariates XX:

EstimandDefinitionPolicy question
ATEE[τ]E[\tau]What if everyone were treated versus no one?
ATTE[τ∣T=1]E[\tau \mid T = 1]Is the programme worth it for those who use it now?
ATCE[τ∣T=0]E[\tau \mid T = 0]What would expanding it to current non-users achieve?
CATEτ(x)=E[τ∣X=x]\tau(x) = E[\tau \mid X = x]For whom does it work? Whom should we target?

They are linked by the LIE (Day 6):

ATE=E[τ(X)],ATT=E[τ(X)∣T=1],ATE=p⋅ATT+(1−p)⋅ATC,\text{ATE} = E[\tau(X)], \qquad \text{ATT} = E[\tau(X) \mid T = 1], \qquad \text{ATE} = p\cdot\text{ATT} + (1 - p)\cdot\text{ATC},

where p=P(T=1)p = P(T = 1) and the second equality uses E[τ∣X,T=1]=τ(X)E[\tau \mid X, T = 1] = \tau(X), which holds when treatment is unconfounded given XX (Day 42). The averages coincide when effects are constant, or more generally when who is treated is unrelated to how much they gain.

Effects on distributions

The quantile treatment effect QTE(q)=FY(1)−1(q)−FY(0)−1(q)\text{QTE}(q) = F_{Y(1)}^{-1}(q) - F_{Y(0)}^{-1}(q) compares the quantiles of the two outcome distributions. It is identified by a randomised experiment. It is not the qq-th quantile of individual effects τi\tau_i, which depends on the joint distribution of (Y(1),Y(0))(Y(1), Y(0)), never observed (Day 31, Exercise 15).

Absolute versus relative effects

For a binary outcome with risks R1=P(Y(1)=1)R_1 = P(Y(1) = 1) and R0=P(Y(0)=1)R_0 = P(Y(0) = 1):

  • Risk difference R1−R0R_1 - R_0 (the ATE); its inverse is the number needed to treat.
  • Risk ratio R1/R0R_1/R_0; vaccine efficacy =1−R1/R0= 1 - R_1/R_0.

The same intervention can look large on one scale and small on another.

Part 1 · Warm-up

A training programme's effect on annual earnings ($1,000) depends on prior earnings XX: τ(low)=3\tau(\text{low}) = 3 and τ(high)=1\tau(\text{high}) = 1. 40% of workers are low earners.

Exercise 1 · ATE from CATEs

Compute the ATE.

Show solution

Step 1. ATE =E[τ(X)]=P(low)τ(low)+P(high)τ(high)= E[\tau(X)] = P(\text{low})\tau(\text{low}) + P(\text{high})\tau(\text{high}).

Step 2. =0.4(3)+0.6(1)=1.2+0.6=1.8= 0.4(3) + 0.6(1) = 1.2 + 0.6 = 1.8.

Answer: $1,800.

Exercise 2 · ATT

80% of low earners and 20% of high earners enrol. Assuming enrolment is unconfounded given XX, compute the ATT.

Show solution

Step 1. Share enrolled: P(T=1)=0.4(0.8)+0.6(0.2)=0.32+0.12=0.44P(T = 1) = 0.4(0.8) + 0.6(0.2) = 0.32 + 0.12 = 0.44.

Step 2. Composition of enrollees: P(low∣T=1)=0.32/0.44≈0.727P(\text{low} \mid T = 1) = 0.32/0.44 \approx 0.727; high ≈0.273\approx 0.273.

Step 3. ATT =0.727(3)+0.273(1)≈2.18+0.27=2.45= 0.727(3) + 0.273(1) \approx 2.18 + 0.27 = 2.45.

Answer: ≈ $2,450: enrollees are disproportionately the workers who gain most.

Exercise 3 · ATC

Compute the ATC.

Show solution

Step 1. Non-enrollees: 1−0.44=0.561 - 0.44 = 0.56; low earners among them 0.4×0.2=0.080.4 \times 0.2 = 0.08, so P(low∣T=0)=0.08/0.56≈0.143P(\text{low} \mid T = 0) = 0.08/0.56 \approx 0.143.

Step 2. ATC =0.143(3)+0.857(1)≈0.43+0.86=1.29= 0.143(3) + 0.857(1) \approx 0.43 + 0.86 = 1.29.

Answer: ≈ $1,290.

Exercise 4 · Check the identity

Verify ATE =p⋅= p\cdotATT +(1−p)⋅+ (1 - p)\cdotATC.

Show solution

Step 1. 0.44(2.455)+0.56(1.286)≈1.080+0.7200.44(2.455) + 0.56(1.286) \approx 1.080 + 0.720.

Step 2. =1.80= 1.80. ✓

Exercise 5 · Vaccine efficacy

In a trial, 1% of vaccinated and 5% of placebo participants are infected. Compute the risk difference, vaccine efficacy and the number needed to vaccinate to prevent one infection.

Show solution

Step 1. Risk difference =0.01−0.05=−0.04= 0.01 - 0.05 = -0.04.

Step 2. Efficacy =1−0.01/0.05=0.80= 1 - 0.01/0.05 = 0.80.

Step 3. Number needed to vaccinate =1/0.04=25= 1/0.04 = 25.

Answer: 4 fewer infections per 100 vaccinated; 80% efficacy; 25 vaccinations per infection prevented.

Part 2 · Proofs

Exercise 6 · ATE is a weighted average of ATT and ATC

Prove ATE =p⋅= p\cdotATT +(1−p)⋅+ (1 - p)\cdotATC.

Show solution

Step 1. Law of total expectation over TT: E[τ]=E[τ∣T=1]P(T=1)+E[τ∣T=0]P(T=0)E[\tau] = E[\tau \mid T = 1]P(T = 1) + E[\tau \mid T = 0]P(T = 0).

Step 2. Substitute the definitions: ATE=p⋅ATT+(1−p)⋅ATC\text{ATE} = p\cdot\text{ATT} + (1 - p)\cdot\text{ATC}. ■\blacksquare

Exercise 7 · ATT through CATEs

Assume E[τ∣X,T=1]=τ(X)E[\tau \mid X, T = 1] = \tau(X) (unconfoundedness). Prove ATT =E[τ(X)∣T=1]= E[\tau(X) \mid T = 1].

Show solution

Step 1. LIE within the treated: ATT=E[τ∣T=1]=E[E[τ∣X,T=1]∣T=1]\text{ATT} = E[\tau \mid T = 1] = E\big[E[\tau \mid X, T = 1] \mid T = 1\big].

Step 2. Replace the inner expectation by τ(X)\tau(X): ATT=E[τ(X)∣T=1]\text{ATT} = E[\tau(X) \mid T = 1]. ■\blacksquare

ATT averages the CATEs over the treated's covariate distribution; ATE averages them over everyone's.

Exercise 8 · When ATT equals ATE

Prove ATT == ATE if (a) effects are constant, or (b) TT is independent of τ\tau.

Show solution

Step 1. (a) If τi=c\tau_i = c for all ii, every average of τ\tau equals cc.

Step 2. (b) Independence means conditioning on TT does not change the distribution of τ\tau: E[τ∣T=1]=E[τ]E[\tau \mid T = 1] = E[\tau].

Answer: randomised experiments satisfy (b), so their treated group's average effect is the ATE. Self-selection on gains breaks (b).

Exercise 9 · Median of differences versus difference of medians

Three workers have (Y(0),Y(1))(Y(0), Y(1)) = (1, 2), (2, 6), (3, 3). Compute the difference in medians and the median of individual effects.

Show solution

Step 1. Y(0)Y(0): 1, 2, 3, median 2. Y(1)Y(1): 2, 6, 3, median 3. Difference of medians: 3−2=13 - 2 = 1.

Step 2. Individual effects: 2−1=12 - 1 = 1, 6−2=46 - 2 = 4, 3−3=03 - 3 = 0. Median of effects: 1.

Step 3. Now keep both marginal distributions but pair them differently: (1, 3), (2, 2), (3, 6). Effects 2, 0, 3: median 2, while the difference of medians is still 1.

Step 4. Another pairing, (1, 6), (2, 3), (3, 2), gives effects 5, 1, −1: one worker in three is now harmed.

Answer: the difference in medians (the QTE at 0.5) is 1 whatever the pairing; the median effect and the share harmed depend on the unobservable pairing.

Exercise 10 · Heterogeneity beyond covariates

Prove Var⁡(τi)≥Var⁡(τ(X))\operatorname{Var}(\tau_i) \ge \operatorname{Var}(\tau(X)).

Show solution

Step 1. Law of total variance (Day 6): Var⁡(τ)=E[Var⁡(τ∣X)]+Var⁡(E[τ∣X])\operatorname{Var}(\tau) = E[\operatorname{Var}(\tau \mid X)] + \operatorname{Var}(E[\tau \mid X]).

Step 2. The first term is non-negative, and E[τ∣X]=τ(X)E[\tau \mid X] = \tau(X).

Step 3. So Var⁡(τ)≥Var⁡(τ(X))\operatorname{Var}(\tau) \ge \operatorname{Var}(\tau(X)). ■\blacksquare

CATEs reveal only the heterogeneity explained by XX; people with the same XX can still respond differently.

Part 3 · Applied

Exercise 11 · Keep, expand or target?

Using Exercises 1–3, a ministry asks three questions: (a) Is the current programme worth its cost of $2,000 per trainee? (b) Should it be made compulsory for all unemployed workers? (c) Should it be offered only to low earners? Which estimand answers each, and what is the answer?

Show solution

Step 1. (a) Current trainees: ATT ≈ $2,450 > $2,000: worth keeping.

Step 2. (b) Everyone: ATE = $1,800 < $2,000: compulsory roll-out fails the cost test.

Step 3. (c) Low earners: CATE = $3,000 > $2,000, while for high earners $1,000 < $2,000: target low earners.

Answer: ATT, ATE and CATE give three different answers, each correct for its question.

Exercise 12 · Extending to non-users

A microfinance programme has ATT = 15% higher business profits among current borrowers. A donor wants to fund outreach to non-borrowers. Why might the ATC be much smaller, and how could you estimate it?

Show solution

Step 1. People borrow when they have profitable projects: selection on gains (Day 34) makes ATT > ATC.

Step 2. The ATC requires E[Y(1)∣T=0]E[Y(1) \mid T = 0], never observed.

Step 3. Ways forward: an encouragement RCT among non-borrowers (identifies effects for those induced to borrow, Day 41), or, under unconfoundedness, CATEs averaged over non-borrowers' covariates.

Answer: expect ATC < ATT. Randomised studies of microcredit generally find modest average effects.

Exercise 13 · A minimum wage and the wage distribution

After a minimum-wage rise, the 10th percentile of wages rises by $1.50 and the median by $0.10. Can we conclude that the lowest-paid 10% of workers gained $1.50 each?

Show solution

Step 1. These are quantile treatment effects: differences between quantiles of two distributions.

Step 2. Workers can change rank: some low earners may lose jobs (dropping out of the wage distribution), others may be pushed above the 10th percentile.

Step 3. So the person at the 10th percentile afterwards need not be the person who was there before.

Answer: no. QTEs describe how the distribution shifted, not individual gains, unless one assumes ranks are preserved (rank invariance).

Exercise 14 · Effects on log wages

A programme raises wages by 10% for half the workers and 0% for the rest. Wages are $10/hour without the programme for everyone. Compute the ATE on wages, the ATE on log wages, and ln⁡E[Y(1)]−ln⁡E[Y(0)]\ln E[Y(1)] - \ln E[Y(0)].

Show solution

Step 1. Y(1)Y(1) is 11 for half and 10 for half: ATE on levels =0.5(1)=0.50= 0.5(1) = 0.50 dollars per hour.

Step 2. ATE on logs =0.5ln⁡(1.1)≈0.5(0.0953)=0.0477= 0.5\ln(1.1) \approx 0.5(0.0953) = 0.0477.

Step 3. Log of means: ln⁡(10.5)−ln⁡(10)≈0.0488\ln(10.5) - \ln(10) \approx 0.0488.

Answer: $0.50; 0.0477; 0.0488. The average of log effects is not the log of the average effect (Jensen); with heterogeneous effects, state the scale of the estimand.

Exercise 15 · Same trial, different headlines

A statin trial reports 10-year heart-attack risk 2% (treated) versus 3% (placebo). Write three headlines: relative risk reduction, absolute risk reduction, and number needed to treat.

Show solution

Step 1. Relative: 1−0.02/0.03≈33%1 - 0.02/0.03 \approx 33\% fewer heart attacks.

Step 2. Absolute: 0.03−0.02=10.03 - 0.02 = 1 percentage point.

Step 3. NNT: 1/0.01=1001/0.01 = 100 people treated for 10 years to prevent one heart attack.

Answer: "a third fewer heart attacks", "1 point lower risk" and "100 treated per attack prevented" describe the same result. Cost-effectiveness needs the absolute effect.

Verify in Python

import numpy as np

rng = np.random.default_rng(33)
n = 1_000_000
low = rng.random(n) < 0.4
tau = np.where(low, 3.0, 1.0)
T = rng.random(n) < np.where(low, 0.8, 0.2)        # enrolment depends on X only
print(f"ATE {tau.mean():.3f}  ATT {tau[T].mean():.3f}  ATC {tau[~T].mean():.3f}  p {T.mean():.3f}")
print("check p*ATT + (1-p)*ATC:", round(T.mean() * tau[T].mean() + (1 - T.mean()) * tau[~T].mean(), 3))

# Vaccine and statin metrics
for name, r1, r0 in (("vaccine", 0.01, 0.05), ("statin", 0.02, 0.03)):
    print(f"{name}: RD {r1 - r0:+.3f}, relative reduction {1 - r1 / r0:.0%}, NNT {1 / (r0 - r1):.0f}")

# Logs versus levels (Exercise 14)
y0 = np.full(2, 10.0); y1 = np.array([11.0, 10.0])
print("ATE levels", (y1 - y0).mean(), " ATE logs", round(np.mean(np.log(y1) - np.log(y0)), 4),
      " log of means", round(np.log(y1.mean()) - np.log(y0.mean()), 4))

Key takeaways

  • ATE, ATT, ATC and CATE answer different policy questions; choose the estimand before the method.
  • ATE = p·ATT + (1 − p)·ATC; they differ when people select on their gains.
  • Distributional and relative effects need care: quantile effects are not individual effects, and scale matters.

Simulation Lab: ATE, ATT, ATC & CATE

Open full screen →

A heterogeneous effect τ(x) averaged over three different populations — and when they coincide.

0123400.20.40.60.81prior earnings rank xeffect / densityATE 2.50ATT 3.04ATC 1.96
effect τ(x)density of x among enrolleesdensity among non-enrolleesdensity in population
share enrolled p
0.50
check p·ATT + (1−p)·ATC
2.500
ATE = 2.500

The effect τ(x) (orange) depends on prior earnings rank x. Who enrols depends on x too. ATT averages τ(x) over the treated's distribution (blue), ATC over the controls' (violet), ATE over everyone's (flat). They coincide only if τ is flat or enrolment ignores x.

Day 32Day 34