Math for Causal Inference

Day 62. The Wald Estimator

With a binary instrument, IV is a ratio of two differences in means. The Wald estimator, its grouped-data generalisation, its delta-method standard error, and the special case of one-sided non-compliance where it recovers the effect on the treated.

Video coming soon
Learning outcomes
  • ●Compute the Wald estimator from group means and relate it to the covariance formula.
  • ●Read IV graphically as the slope through group means.
  • ●Derive a delta-method standard error for a ratio of differences.
  • ●Prove that with one-sided non-compliance the Wald estimator equals the effect of treatment on the treated.
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

Binary instrument

Let Z∈{0,1}Z \in \{0, 1\} (won a lottery, born in an eligible year, offered a voucher). The Wald estimator is

β^W=Yˉ1−Yˉ0Xˉ1−Xˉ0,\hat\beta_{W} = \frac{\bar Y_1 - \bar Y_0}{\bar X_1 - \bar X_0},

where Yˉz,Xˉz\bar Y_z, \bar X_z are means among units with Z=zZ = z. The numerator is the reduced form (intention-to-treat effect on YY), the denominator the first stage (effect of ZZ on XX; for binary XX, the difference in take-up rates).

Same as IV

For binary ZZ, Cov⁡(Z,Y)=p(1−p)(Yˉ1−Yˉ0)\operatorname{Cov}(Z, Y) = p(1 - p)(\bar Y_1 - \bar Y_0) with p=P(Z=1)p = P(Z = 1), and similarly for XX. The factor p(1−p)p(1 - p) cancels, so the Wald estimator is the IV estimator.

The picture

Plot the two group means (Xˉ0,Yˉ0)(\bar X_0, \bar Y_0) and (Xˉ1,Yˉ1)(\bar X_1, \bar Y_1): the Wald estimate is the slope of the line through them. With several groups (quarters of birth, lottery cohorts), fitting a line through the group means, weighted by group size, is 2SLS with group dummies as instruments (Angrist's grouping estimator).

Standard error

By the delta method, with reduced form ρ^\hat\rho, first stage π^\hat\pi and β^=ρ^/π^\hat\beta = \hat\rho/\hat\pi,

Var⁡(β^)≈Var⁡(ρ^)+β2Var⁡(π^)−2βCov⁡(ρ^,π^)π2.\operatorname{Var}(\hat\beta) \approx \frac{\operatorname{Var}(\hat\rho) + \beta^2\operatorname{Var}(\hat\pi) - 2\beta\operatorname{Cov}(\hat\rho, \hat\pi)}{\pi^2}.

A small first stage π\pi inflates the variance quadratically (Day 65).

One-sided non-compliance

If nobody with Z=0Z = 0 can get treated (a programme only lottery winners can join), then under exclusion the Wald estimator equals the effect of treatment on the treated (Bloom's result). Phase 3, Day 41, called the same ratio the CACE; Day 63 develops the general case.

Part 1 · Warm-up

Exercise 1 · A first Wald estimate

Mean outcomes are 52 (Z=1Z = 1) and 50 (Z=0Z = 0); treatment rates 0.6 and 0.2. Compute the Wald estimate.

Show solution

Step 1. Reduced form: 52−50=252 - 50 = 2.

Step 2. First stage: 0.6−0.2=0.40.6 - 0.2 = 0.4.

Step 3. β^W=2/0.4=5\hat\beta_W = 2/0.4 = 5.

Exercise 2 · Slope through two points

Show that the line through (Xˉ0,Yˉ0)=(0.2,50)(\bar X_0, \bar Y_0) = (0.2, 50) and (Xˉ1,Yˉ1)=(0.6,52)(\bar X_1, \bar Y_1) = (0.6, 52) has slope 5.

Show solution

Step 1. Slope =(52−50)/(0.6−0.2)=2/0.4=5= (52 - 50)/(0.6 - 0.2) = 2/0.4 = 5, the Wald estimate.

Exercise 3 · Grouped data

Three cohorts have mean schooling and mean wage (10, 20), (12, 23), (14, 26), with equal sizes. What is the grouping estimator?

Show solution

Step 1. The points lie on a line: each 2 extra years add 3 to the wage.

Step 2. Slope =3/2=1.5= 3/2 = 1.5.

Answer: 1.5 per year of schooling.

Exercise 4 · A standard error

Reduced form 2 (SE 0.5), first stage 0.4 (SE 0.02), estimates uncorrelated. Compute the delta-method SE of β^=5\hat\beta = 5.

Show solution

Step 1. Numerator: 0.52+52(0.02)2=0.25+0.01=0.260.5^2 + 5^2(0.02)^2 = 0.25 + 0.01 = 0.26.

Step 2. SE⁡≈0.26/0.4≈0.51/0.4≈1.27\operatorname{SE} \approx \sqrt{0.26}/0.4 \approx 0.51/0.4 \approx 1.27.

Answer: about 1.27; most of the uncertainty comes from the reduced form.

Exercise 5 · Signs

The reduced form is +3 and the first stage −0.5. What is the Wald estimate, and what does the negative first stage mean?

Show solution

Step 1. β^W=3/(−0.5)=−6\hat\beta_W = 3/(-0.5) = -6.

Step 2. The instrument lowers take-up, and the outcome rises: so the treatment lowers the outcome.

Answer: −6. Recoding ZZ as 1−Z1 - Z flips both signs and leaves the estimate unchanged.

Part 2 · Proofs

Exercise 6 · Wald equals IV

For binary ZZ with p=P(Z=1)p = P(Z = 1), prove Cov⁡(Z,Y)=p(1−p)(E[Y∣Z=1]−E[Y∣Z=0])\operatorname{Cov}(Z, Y) = p(1 - p)(E[Y \mid Z = 1] - E[Y \mid Z = 0]), and conclude that the Wald estimand equals Cov⁡(Z,Y)/Cov⁡(Z,X)\operatorname{Cov}(Z, Y)/\operatorname{Cov}(Z, X).

Show solution

Step 1. Cov⁡(Z,Y)=E[ZY]−E[Z]E[Y]=pE[Y∣Z=1]−p(pE[Y∣Z=1]+(1−p)E[Y∣Z=0])\operatorname{Cov}(Z, Y) = E[ZY] - E[Z]E[Y] = pE[Y \mid Z = 1] - p\big(pE[Y \mid Z = 1] + (1 - p)E[Y \mid Z = 0]\big).

Step 2. =p(1−p)E[Y∣Z=1]−p(1−p)E[Y∣Z=0]= p(1 - p)E[Y \mid Z = 1] - p(1 - p)E[Y \mid Z = 0].

Step 3. The same holds for XX; the factor p(1−p)p(1 - p) cancels in the ratio. ■\blacksquare

Exercise 7 · Delta method for a ratio

Let g(ρ,π)=ρ/πg(\rho, \pi) = \rho/\pi. Derive the delta-method variance in the theory.

Show solution

Step 1. Gradient: ∂g/∂ρ=1/π\partial g/\partial\rho = 1/\pi, ∂g/∂π=−ρ/π2=−β/π\partial g/\partial\pi = -\rho/\pi^2 = -\beta/\pi.

Step 2. Var⁡(g)≈∇g⊤Σ∇g=1π2Var⁡(ρ^)+β2π2Var⁡(π^)−2βπ2Cov⁡(ρ^,π^)\operatorname{Var}(g) \approx \nabla g^\top\boldsymbol\Sigma\nabla g = \frac{1}{\pi^2}\operatorname{Var}(\hat\rho) + \frac{\beta^2}{\pi^2}\operatorname{Var}(\hat\pi) - \frac{2\beta}{\pi^2}\operatorname{Cov}(\hat\rho, \hat\pi).

Step 3. Factor out 1/π21/\pi^2. ■\blacksquare (Day 12.)

Exercise 8 · One-sided non-compliance gives the ATT

Let ZZ be random, D∈{0,1}D \in \{0, 1\} with D=0D = 0 whenever Z=0Z = 0, and exclusion: Y=Y(D)Y = Y(D) does not depend on ZZ otherwise. Prove the Wald estimand equals E[Y(1)−Y(0)∣D=1]E[Y(1) - Y(0) \mid D = 1].

Show solution

Step 1. Reduced form: E[Y∣Z=1]−E[Y∣Z=0]=E[Y(0)+D(Y(1)−Y(0))∣Z=1]−E[Y(0)∣Z=0]E[Y \mid Z = 1] - E[Y \mid Z = 0] = E[Y(0) + D(Y(1) - Y(0)) \mid Z = 1] - E[Y(0) \mid Z = 0].

Step 2. Randomisation: E[Y(0)∣Z=1]=E[Y(0)∣Z=0]E[Y(0) \mid Z = 1] = E[Y(0) \mid Z = 0], so the reduced form is E[D(Y(1)−Y(0))∣Z=1]E[D(Y(1) - Y(0)) \mid Z = 1].

Step 3. =P(D=1∣Z=1) E[Y(1)−Y(0)∣D=1,Z=1]= P(D = 1 \mid Z = 1)\,E[Y(1) - Y(0) \mid D = 1, Z = 1].

Step 4. First stage: P(D=1∣Z=1)−0P(D = 1 \mid Z = 1) - 0. Ratio: E[Y(1)−Y(0)∣D=1,Z=1]E[Y(1) - Y(0) \mid D = 1, Z = 1].

Step 5. Everyone with D=1D = 1 has Z=1Z = 1, so this is the ATT. ■\blacksquare

Exercise 9 · Grouping estimator with two groups

Prove that the IV estimator with a binary instrument equals the slope of the line through the two sample group means.

Show solution

Step 1. Exercise 6 holds in the sample too: Cov⁡^(Z,Y)=p^(1−p^)(Yˉ1−Yˉ0)\widehat{\operatorname{Cov}}(Z, Y) = \hat p(1 - \hat p)(\bar Y_1 - \bar Y_0) (with the same divisor for both covariances).

Step 2. The ratio is (Yˉ1−Yˉ0)/(Xˉ1−Xˉ0)(\bar Y_1 - \bar Y_0)/(\bar X_1 - \bar X_0), which is the slope through the two points. ■\blacksquare

Exercise 10 · A direct effect of the instrument

If ZZ also affects YY directly by δ\delta (exclusion fails), show the Wald estimand is β+δ/π\beta + \delta/\pi in the constant-effect model Y=α+βX+δZ+εY = \alpha + \beta X + \delta Z + \varepsilon, E[ε∣Z]=0E[\varepsilon \mid Z] = 0.

Show solution

Step 1. E[Y∣Z=1]−E[Y∣Z=0]=β(E[X∣Z=1]−E[X∣Z=0])+δ=βπ+δE[Y \mid Z = 1] - E[Y \mid Z = 0] = \beta(E[X \mid Z = 1] - E[X \mid Z = 0]) + \delta = \beta\pi + \delta.

Step 2. Divide by π\pi: β+δ/π\beta + \delta/\pi. ■\blacksquare

Part 3 · Applied

Exercise 11 · Draft lottery and earnings

In a stylised version of Angrist (1990), men with draft-eligible lottery numbers earn $15,600 a year later in life versus $16,050 for ineligible men. Their veteran rates are 0.35 and 0.19. Estimate the earnings effect of military service.

Show solution

Step 1. Reduced form: 15,600−16,050=−45015{,}600 - 16{,}050 = -450.

Step 2. First stage: 0.35−0.19=0.160.35 - 0.19 = 0.16.

Step 3. β^W=−450/0.16=−2,812.5\hat\beta_W = -450/0.16 = -2{,}812.5.

Answer: serving lowers annual earnings by about $2,800 for men whose service depended on the lottery.

Exercise 12 · Health insurance lottery

In a stylised Oregon-style lottery, winners average 1.10 emergency-room visits a year and losers 1.00; insurance coverage is 43% versus 18%. Estimate the effect of insurance on ER visits.

Show solution

Step 1. Reduced form: 1.10−1.00=0.101.10 - 1.00 = 0.10 visits.

Step 2. First stage: 0.43−0.18=0.250.43 - 0.18 = 0.25.

Step 3. β^W=0.10/0.25=0.40\hat\beta_W = 0.10/0.25 = 0.40.

Answer: insurance raises ER use by 0.4 visits a year among people who took it up because they won, contradicting the hope that coverage would reduce ER use.

Exercise 13 · Quarter of birth

Mean schooling and log weekly wages by quarter of birth (equal cohort sizes): Q1 (12.70, 5.892), Q2 (12.80, 5.900), Q3 (12.85, 5.904), Q4 (12.90, 5.908). Estimate the return to schooling by the grouping estimator.

Show solution

Step 1. Means: xˉ=12.8125\bar x = 12.8125, yˉ=5.901\bar y = 5.901.

Step 2. Deviations of xx: −0.1125, −0.0125, 0.0375, 0.0875; of yy: −0.009, −0.001, 0.003, 0.007.

Step 3. ∑dx dy=0.0010125+0.0000125+0.0001125+0.0006125=0.00175\sum dx\,dy = 0.0010125 + 0.0000125 + 0.0001125 + 0.0006125 = 0.00175; ∑dx2=0.021875\sum dx^2 = 0.021875.

Step 4. Slope =0.00175/0.021875=0.08= 0.00175/0.021875 = 0.08.

Answer: 8% per year. Tiny differences in group means identify the effect, which is why such designs need very large samples (Day 65).

Exercise 14 · A training voucher only winners could use

Only lottery winners could use a training voucher; 60% of winners used it. Winners earn $300 a year more than losers. Estimate the effect on those trained.

Show solution

Step 1. One-sided non-compliance: first stage 0.6−0=0.60.6 - 0 = 0.6.

Step 2. β^W=300/0.6=500\hat\beta_W = 300/0.6 = 500.

Answer: $500 a year, the ATT (Exercise 8).

Exercise 15 · A confidence interval for the draft effect

In Exercise 11, the reduced form has SE $200 and the first stage SE 0.01, uncorrelated. Compute a 95% confidence interval for the effect of service.

Show solution

Step 1. Numerator: 2002+(−2,812.5)2(0.01)2=40,000+791=40,791200^2 + (-2{,}812.5)^2(0.01)^2 = 40{,}000 + 791 = 40{,}791.

Step 2. SE ≈40,791/0.16≈202/0.16≈1,262\approx \sqrt{40{,}791}/0.16 \approx 202/0.16 \approx 1{,}262.

Step 3. CI: −2,812.5±1.96×1,262≈[−5,287,  −338]-2{,}812.5 \pm 1.96 \times 1{,}262 \approx [-5{,}287,\; -338].

Answer: negative but imprecise. With a weak first stage the delta method can be unreliable; Day 65 gives better intervals.

Verify in Python

import numpy as np

rng = np.random.default_rng(62)
# A simulated lottery: Z random, compliers/always/never takers, effect -2800 for those who serve
n = 400_000
Z = rng.random(n) < .3
kind = rng.choice(["c", "a", "n"], size=n, p=[.16, .19, .65])
D = (kind == "a") | ((kind == "c") & Z)
Y0 = rng.normal(16_000 + 600 * (kind == "a"), 5_000, n)
Y = Y0 - 2_800 * D
rf = Y[Z].mean() - Y[~Z].mean(); fs = D[Z].mean() - D[~Z].mean()
iv = np.cov(Z, Y)[0, 1] / np.cov(Z, D)[0, 1]
print(f"reduced form {rf:.0f}, first stage {fs:.3f}, Wald {rf / fs:.0f}, covariance IV {iv:.0f}")

# Delta-method SE versus the bootstrap
var_rf = Y[Z].var() / Z.sum() + Y[~Z].var() / (~Z).sum()
var_fs = D[Z].var() / Z.sum() + D[~Z].var() / (~Z).sum()
b = rf / fs
cov = np.cov(Y[Z], D[Z])[0, 1] / Z.sum() + np.cov(Y[~Z], D[~Z])[0, 1] / (~Z).sum()
print(f"delta-method SE {np.sqrt(var_rf + b**2 * var_fs - 2 * b * cov) / abs(fs):.0f}")
boot = []
for _ in range(200):
    i = rng.integers(0, n, n); z, d, y = Z[i], D[i], Y[i]
    boot.append((y[z].mean() - y[~z].mean()) / (d[z].mean() - d[~z].mean()))
print(f"bootstrap SE {np.std(boot):.0f}")

# Exercises 11, 13, 15
b = -450 / .16
print("draft:", b, " SE", round(np.sqrt(200**2 + b**2 * .01**2) / .16), " CI", np.round([b - 1.96 * 1262.3, b + 1.96 * 1262.3]))
x = np.array([12.7, 12.8, 12.85, 12.9]); y = np.array([5.892, 5.900, 5.904, 5.908])
print("quarter-of-birth slope:", round(np.polyfit(x, y, 1)[0], 4))

Key takeaways

  • With a binary instrument, IV is the Wald ratio: difference in outcomes over difference in treatment between instrument groups.
  • Graphically, it is the slope through group means; with many groups, a size-weighted line through the means is 2SLS.
  • Its delta-method variance is inflated by 1/π21/\pi^2; with one-sided non-compliance it estimates the effect on the treated.

Simulation Lab: The Wald & Grouping Estimator

Open full screen →

Draft-lottery groups: the slope through group means estimates the effect of service; veterans-versus-others does not.

1415161700.20.40.6share who servedmean earnings ($1,000)
Wald estimate
-2.78
veterans vs others
-2.34
truth
-2.80

Lottery groups differ only in their draft risk. Each dot is a group: its veteran share (x) and mean earnings (y). The slope through the group means is the Wald estimate (2 groups) or the grouping (2SLS) estimate (more groups). Comparing veterans with non-veterans instead mixes in volunteers, who would earn more anyway.

Day 61Day 63