Skip to content
Tutorials Center
My learning

Topics

Lesson 23 of 37 ยท Instrumental Variables and DiD

Instrumental Variables

Understand instrumental variables: the three assumptions, the Wald estimator, what a LATE means, and how an instrument rescues an effect that unmeasured confounding ruins.

Matching and weighting need you to measure every confounder. What if you can't? Suppose motivation drives both who takes a training program and how well they later perform, and nobody measured motivation. Adjusting for the covariates you have will not help, because the key confounder is hidden.

An instrumental variable (IV) offers a way out. It is a variable that nudges people into treatment but has no other route to the outcome. Natural experiments often provide them: a lottery, a distance to a college, a random assignment of a judge, an encouragement email that was sent at random. The instrument supplies a slice of variation in treatment that is "as good as random", and you estimate the effect using only that slice.

The picture

flowchart LR
    Z["Instrument Z"] --> T["Treatment T"]
    T --> Y["Outcome Y"]
    U["Unmeasured U"] --> T
    U --> Y

Z moves T, and the only way Z can reach Y is through T.

The three assumptions

  1. Relevance. Z is associated with T. You can test this.
  2. Independence (as-if random). Z is unrelated to the unmeasured confounders U. Randomization of Z guarantees it; otherwise you argue it.
  3. Exclusion restriction. Z affects Y only through T. This cannot be tested from data; it must be defended with subject knowledge.

For a binary treatment you also need monotonicity: the instrument never pushes anyone away from treatment (no "defiers"). Under these conditions IV identifies a local average treatment effect (LATE): the effect for compliers, the people whose treatment status actually changes with the instrument.

The Wald estimator

With a binary instrument the estimate is a ratio of two differences:

LATE = (E[Y | Z=1] - E[Y | Z=0]) / (E[T | Z=1] - E[T | Z=0])

The numerator (the reduced form or intent-to-treat effect) is the effect of the instrument on the outcome. The denominator (the first stage) is how much the instrument moves treatment. Dividing rescales the effect of "being nudged" into the effect of "being treated".

Python OLS versus IV when a confounder is hidden

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The naive comparison is badly biased upward because motivated people are more likely to take the treatment and have better outcomes. The Wald estimate, which never touches u, lands near 1.0. Here the effect is the same for everyone, so the LATE equals the overall effect. When effects differ between people, LATE only describes compliers.

The cost: precision

IV buys unbiasedness with variance. You use only the part of treatment variation driven by Z, so standard errors are larger, sometimes much larger. A weak instrument (a small first stage) is the worst case: estimates become noisy and biased toward the naive answer.

Python Weak versus strong instruments

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

With the strong instrument the estimates cluster near 1.0. With the weak instrument the spread is huge, and individual estimates can be wildly wrong. The next lesson shows how to test instrument strength.

Where instruments come from

  • Randomized encouragement. Randomly send a reminder; only some respond. The reminder is the instrument for taking the action.
  • Natural randomization. Draft lotteries, random assignment of judges or caseworkers, weather shocks, birth-date cutoffs.
  • Policy or geography. Distance to a hospital, rules that changed at a border. These need careful arguments for the exclusion restriction.

A good instrument is judged mostly by story, not by statistics. Always ask: "Could Z affect Y in any way that does not go through T?" If you can think of one, the estimate is suspect.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which assumption can NOT be tested directly with data?

    The exclusion restriction says the instrument affects the outcome only through the treatment. It involves unobservable paths, so it must be argued.
  2. 2. What does the Wald estimator divide by?

    The reduced form is divided by the first stage to convert the effect of the nudge into the effect of treatment.
  3. 3. Whom does the LATE describe?

    IV learns from units whose treatment status the instrument can change.
  4. 4. What is the main risk of a weak instrument?

    A tiny first stage divides a noisy numerator by a number near zero.

Summary

  • An instrument shifts treatment, is as good as random, and affects the outcome only through treatment.
  • The Wald estimator is the reduced form divided by the first stage.
  • With heterogeneous effects, IV estimates the LATE for compliers.
  • IV trades bias for variance; weak instruments are dangerous.
  • The exclusion restriction can only be defended with domain knowledge.

Next: Two-Stage Least Squares