Math for Causal Inference

Day 80. Phase 5 Capstone: Choosing a Design

Instruments, differences-in-differences, discontinuities and bounds answer different questions under different assumptions. How to match a design to the variation available, what each one estimates, which diagnostics make it credible, and how designs can be combined.

Video coming soon
Learning outcomes
  • ●Match a policy question and its data to IV, DiD, RD, RKD or bounds, and name the estimand each delivers.
  • ●List the identifying assumption and the main diagnostics for each design.
  • ●Combine designs (Wald-DiD, difference in discontinuities) and prove when they work.
  • ●Explain why credible designs can give different numbers for the "same" effect.
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

Start from the variation

The first question is not "which estimator?" but "what moves treatment for reasons unrelated to outcomes?"

Source of variationDesignEstimandKey assumptionDiagnostics
You randomiseRCT (Phase 3)ATE (or ITT)randomisation, no attrition biasbalance, attrition, compliance
A random or as-good-as-random nudge to take-upIV (61–66)LATE for compliersindependence, exclusion, monotonicityfirst stage F, balance on Z, AR intervals, complier profile
A policy changes for some groups at some timeDiD / event study (67–72)ATT for treated groupsparallel trends, no anticipationpre-trends, placebo outcomes, sensitivity bounds, robust staggered estimators
A rule assigns treatment at a thresholdRD (73–77)effect at the cutoff (compliers there if fuzzy)continuity at the cutoffdensity test, covariate balance, placebo cutoffs, bandwidth sensitivity
A rule changes the slope of a scheduleRKD (78)marginal effect at the kinksmoothnessslope placebo, density derivative
None of the above is crediblebounds (79), sensitivity (95)identified setonly what you statetransparency about assumptions

Estimands differ

Each design answers a question about a particular group: compliers with a lottery, treated states, students at a test-score cutoff. With heterogeneous effects, credible designs applied to the same policy can legitimately disagree. Before comparing numbers, compare estimands.

Combining designs

  • Wald-DiD (fuzzy DiD): if a policy raises take-up in treated groups, divide the DiD in outcomes by the DiD in take-up.
  • Difference in discontinuities: if a jump already existed at a cutoff before a policy started applying there, subtract the old jump from the new one.
  • RD + bounds, IV + DiD, event studies with instruments: assumptions combine, and so do diagnostics.

A workflow

  1. State the causal question and the estimand (whose effect, of what, on what, when).
  2. Describe the assignment mechanism with institutional detail; draw the DAG.
  3. Choose the design that matches the variation; state its assumptions plainly.
  4. Run the diagnostics; report the reduced form or raw comparisons graphically.
  5. Report estimates with robust inference and sensitivity analyses.
  6. Discuss external validity: for whom does the estimate speak?

Part 1 · Warm-up

Exercise 1 · Match the design

Name the design: (a) A city lets residents enter a lottery for housing vouchers. (b) A province raises its minimum wage; neighbouring provinces do not. (c) Children born after 1 September start school a year later. (d) A disability benefit replaces 60% of earnings up to a cap. (e) An NGO enrols villages based on undocumented criteria, with no comparison group.

Show solution

Step 1. (a) IV (lottery as instrument; ITT plus LATE).

Step 2. (b) DiD / event study.

Step 3. (c) RD on birth date (fuzzy, as some parents defer).

Step 4. (d) RKD at the cap.

Step 5. (e) Bounds or selection on observables with sensitivity analysis; no clean design.

Exercise 2 · What can be checked?

For IV, DiD and RD, name one implication of the key assumption that can be checked in data and one part that cannot.

Show solution

Step 1. IV: balance of pre-determined covariates across instrument values (checkable); exclusion (not checkable).

Step 2. DiD: parallel pre-trends (checkable); parallel post-treatment trends (not).

Step 3. RD: density and covariate continuity (checkable); continuity of potential outcomes themselves (not directly).

Exercise 3 · Three numbers for one programme

A school-meals programme is evaluated three ways: an RD at the eligibility income cutoff (+0.12 sd in test scores), a DiD across districts that adopted early (+0.08), and a lottery among oversubscribed schools (+0.15 per pupil fed). Should they agree?

Show solution

Step 1. RD: effect for pupils at the income cutoff.

Step 2. DiD: ATT for pupils in early-adopting districts (a mix of incomes).

Step 3. Lottery IV: LATE for pupils in oversubscribed schools who ate because their school won.

Answer: not necessarily; with heterogeneous effects they estimate different averages. Disagreement is informative about heterogeneity, provided each design passes its diagnostics.

Exercise 4 · Name the estimand

Give the estimand of each: a sharp RD; a fuzzy RD; a Wald estimator with one-sided non-compliance; a 2×2 DiD; Lee bounds.

Show solution

Step 1. Sharp RD: ATE at the cutoff.

Step 2. Fuzzy RD: LATE for compliers at the cutoff.

Step 3. One-sided Wald: ATT (effect on the treated).

Step 4. 2×2 DiD: ATT for the treated group in the post period.

Step 5. Lee bounds: an interval for the effect on always-observed units.

Exercise 5 · A diagnostics list

For a staggered DiD of a state paid-leave law, list four diagnostics.

Show solution

Step 1. Event-study pre-trends using a heterogeneity-robust estimator.

Step 2. Bacon decomposition of TWFE to see forbidden comparisons.

Step 3. Placebo outcomes (groups not covered by the law).

Step 4. Sensitivity to bounded violations of parallel trends (breakdown value).

Part 2 · Proofs

Exercise 6 · Wald-DiD

Suppose a reform raises take-up DD more in group 1 than in group 0, and Y=αg+λt+τD+εY = \alpha_g + \lambda_t + \tau D + \varepsilon with a constant effect τ\tau and parallel trends in ε\varepsilon. Prove that the DiD in YY divided by the DiD in DD equals τ\tau.

Show solution

Step 1. Group-period means: Yˉgt=αg+λt+τDˉgt+εˉgt\bar Y_{gt} = \alpha_g + \lambda_t + \tau\bar D_{gt} + \bar\varepsilon_{gt}.

Step 2. DiD in YY: the αg\alpha_g and λt\lambda_t cancel; parallel trends cancels the ε\varepsilon terms; left with τ×\tau\times DiD in DD.

Step 3. Divide (DiD in DD non-zero). ■\blacksquare With heterogeneous effects, extra assumptions are needed for a LATE interpretation (de Chaisemartin and D'Haultfœuille).

Exercise 7 · Difference in discontinuities

A cutoff at age 65 had a jump J0J_0 in employment before a pension reform (from other age-65 rules) and J1J_1 after the reform also started at 65. Show that J1−J0J_1 - J_0 identifies the reform's effect at 65 if the other rules' jump is unchanged.

Show solution

Step 1. J0=δJ_0 = \delta (other rules); J1=δ+τJ_1 = \delta + \tau (other rules plus reform).

Step 2. J1−J0=τJ_1 - J_0 = \tau when δ\delta is the same in both periods. ■\blacksquare This combines RD's local comparison with DiD's removal of a stable confounder.

Exercise 8 · Placebo outcomes

Show that under parallel trends, a DiD on an outcome that treatment cannot affect has expectation zero, and explain what a non-zero placebo implies.

Show solution

Step 1. For an unaffected outcome, Y(1)=Y(0)Y(1) = Y(0), so the ATT is zero.

Step 2. By Day 67, Exercise 9, the DiD equals ATT + trend bias = trend bias.

Answer: if parallel trends holds for the placebo, its DiD is zero in expectation; a non-zero placebo reveals differential trends, which may also affect the real outcome (if the outcomes share trend drivers). ■\blacksquare

Exercise 9 · OLS or IV by mean squared error

OLS has bias bb and variance vOv_O; IV is unbiased with variance vI>vOv_I > v_O. Show IV has lower MSE iff b2>vI−vOb^2 > v_I - v_O.

Show solution

Step 1. MSEOLS=b2+vO\text{MSE}_{OLS} = b^2 + v_O; MSEIV=vI\text{MSE}_{IV} = v_I.

Step 2. vI<b2+vO  ⟺  b2>vI−vOv_I < b^2 + v_O \iff b^2 > v_I - v_O. ■\blacksquare With a weak instrument, vIv_I can be so large that a biased OLS is closer to the truth, but its bias is unknown, so IV's confidence interval is the honest summary.

Exercise 10 · Reweighting for external validity

Suppose effects vary only with a covariate XX: τ(x)\tau(x), and a study identifies τ(x)\tau(x) for each xx in its sample. Show the ATE for a target population with covariate distribution QQ is ∫τ(x) dQ(x)\int\tau(x)\,dQ(x), and that the study's own average uses its own distribution PP.

Show solution

Step 1. Target ATE: EQ[Y(1)−Y(0)]=EQ[E[Y(1)−Y(0)∣X]]=EQ[τ(X)]E_Q[Y(1) - Y(0)] = E_Q[E[Y(1) - Y(0) \mid X]] = E_Q[\tau(X)].

Step 2. The study's average is EP[τ(X)]E_P[\tau(X)]; they differ when P≠QP \ne Q and τ\tau varies.

Answer: reweighting the study's conditional effects to the target's covariate mix transports the estimate, if effects depend only on observed XX (and QQ's support is covered). ■\blacksquare

Part 3 · Applied

Exercise 11 · Minimum wages: two designs

One study compares contiguous border counties across state lines (DiD with county pairs); another uses the bunching of wages at the new minimum to count jobs lost below it. What does each assume, and why might they disagree?

Show solution

Step 1. Border-pair DiD: parallel trends between neighbouring counties; estimates employment effects for those counties.

Step 2. Bunching: jobs that disappear below the new minimum versus excess jobs at and above it, relative to a counterfactual wage distribution; assumes the counterfactual distribution can be predicted (e.g., from other states).

Answer: they use different variation and estimands; disagreement may come from spillovers up the wage distribution or from local labour-market differences. Each paper's diagnostics, not its design label, decide credibility.

Exercise 12 · Class size: RD versus an experiment

The Tennessee STAR experiment found that classes about 7 pupils smaller raised scores by about 0.2 sd; Maimonides' rule RD finds about 0.25 points per pupil on a different test in Israel. How should these be compared?

Show solution

Step 1. Put both in comparable units (sd per pupil): STAR ≈ 0.03 sd per pupil; convert the RD estimate using the test's sd.

Step 2. Estimands differ: STAR's ATE for kindergarten to grade 3 in Tennessee; the RD's effect at the 40-pupil threshold in Israeli schools.

Answer: agreement in standardised units across designs increases confidence; differences may reflect age, baseline class size and context rather than bias.

Exercise 13 · Compulsory schooling: IV or RD?

Evaluate two designs for the effect of an extra year of schooling: (a) IV using changes in compulsory-schooling laws across states and cohorts; (b) RD on school-entry birth-date cutoffs.

Show solution

Step 1. (a) LATE for students who stay in school only because of the law (likely low-attainment); threats: other policies changing with the laws, weak first stages.

Step 2. (b) Compares children born just before and after the cutoff: they differ in school-starting age and in age at test, not only in years of schooling; exclusion is problematic for "years of schooling".

Answer: (a) speaks to compulsory schooling policy for dropouts; (b) is better suited to the effect of school-starting age.

Exercise 14 · A staggered hospital payment reform

A country moves hospitals from fee-for-service to bundled payments, region by region over four years, plus one region that never switches. Design the evaluation.

Show solution

Step 1. Estimand: ATT on cost per episode and readmissions, by years since adoption.

Step 2. Design: group-time ATTs (Callaway–Sant'Anna) with never-treated and not-yet-treated regions; event-study aggregation over a balanced window.

Step 3. Diagnostics: pre-trends, placebo outcomes (conditions not covered by bundles), Bacon decomposition of any TWFE estimate, sensitivity to bounded violations.

Step 4. Inference clustered by region (few clusters: wild bootstrap or randomisation inference over adoption dates).

Exercise 15 · One world, three estimands

In the simulation below, a programme's effect is larger for poorer households: τ(x)=2−1.5x\tau(x) = 2 - 1.5x for a poverty score x∈[−1,1]x \in [-1, 1] (lower is poorer). Households with x<0x < 0 are eligible; a lottery among eligible households offers places, and poorer households comply more. Compute the population ATE, the ATE among eligible households, the RD estimate at the eligibility cutoff (using a hypothetical universal take-up rule), and the lottery's LATE.

Show solution

Step 1. Population ATE: 2−1.5E[x]=22 - 1.5E[x] = 2.

Step 2. Eligible ATE: 2−1.5(−0.5)=2.752 - 1.5(-0.5) = 2.75.

Step 3. RD at the cutoff: τ(0)=2\tau(0) = 2.

Step 4. Lottery LATE: compliers are poorer than the average eligible household, so the LATE exceeds 2.75 (the code finds about 2.9).

Answer: four correct numbers for four questions. Policy makers need the one matching the decision: expanding eligibility (RD-type), scaling up within the eligible (eligible ATE), or improving outreach (LATE-type).

Verify in Python

import numpy as np

rng = np.random.default_rng(80); n = 2_000_000
x = rng.uniform(-1, 1, n)
tau = 2 - 1.5 * x
y0 = 5 + x + rng.normal(0, 1, n)
eligible = x < 0
print(f"population ATE {tau.mean():.3f}   eligible ATE {tau[eligible].mean():.3f}")

# Sharp RD at the cutoff with universal take-up for the eligible
d_rd = eligible.astype(float); y = y0 + d_rd * tau
def side(xx, yy, h=.2):
    w = np.clip(1 - np.abs(xx) / h, 0, None); m = w > 0
    X = np.column_stack([np.ones(m.sum()), xx[m]]); W = w[m]
    return np.linalg.solve(X.T @ (W[:, None] * X), X.T @ (W * yy[m]))[0]
rd = side(-x[eligible], y[eligible]) - side(x[~eligible], y[~eligible])
print(f"RD at cutoff {rd:.3f} (tau(0) = 2)")

# Lottery among the eligible; poorer households comply more
e = eligible
Z = rng.random(n) < .5
comply = rng.random(n) < (0.3 - 0.6 * x)          # poorer households (x near -1) comply with prob 0.9, those near 0 with 0.3
D = e & Z & comply
yL = y0 + D * tau
wald = (yL[e & Z].mean() - yL[e & ~Z].mean()) / (D[e & Z].mean() - D[e & ~Z].mean())
print(f"lottery LATE {wald:.3f}  (true complier average {tau[e & comply].mean():.3f})")

# Exercise 9: OLS vs IV by MSE
b, vO, vI = .05, .0001, .0016
print("IV preferred by MSE:", b ** 2 > vI - vO)

Key takeaways

  • Start from the source of exogenous variation; it determines the design, its assumptions and its estimand.
  • Every design has testable implications; run them, plot the raw comparisons and report robust inference.
  • Credible designs can disagree because they target different people; designs can also be combined (Wald-DiD, difference in discontinuities) when one alone is not enough.

Simulation Lab: Choosing a Design

Open full screen →

Answer questions about your setting and get the design, estimand, assumptions and diagnostics.

Can you (or did someone) randomly assign the treatment?
Is there a lottery, rule or shock that changes take-up but affects outcomes only through treatment?
Is treatment (or its intensity) assigned by a known cutoff on a score, age, date or distance?
Does the rule change the slope of a schedule (a cap or kink) rather than switching treatment on?
Does crossing the cutoff switch treatment on for (almost) everyone?
Do you observe treated and untreated groups both before and after treatment starts?
Do different groups start treatment at different times?
Do you observe all the variables that drive both treatment and the outcome?
RECOMMENDED DESIGN
Fuzzy regression discontinuity
ESTIMAND
LATE for compliers at the cutoff
KEY ASSUMPTIONS
Continuity, monotonicity, exclusion of the cutoff
DIAGNOSTICS
First-stage jump (strength), all sharp-RD checks, weak-IV robust intervals
Covered on days 76–77
questions on the decision path

Answer the questions about your setting. The tool follows the decision path (highlighted questions are the ones that mattered) and recommends a design, the effect it estimates, its key assumptions and the diagnostics that make it credible, with the days where each is covered.

Day 79Back to Phase 5