Instrumental Variables

Using Outside Shocks to Isolate a Causal Effect

Instructor

Fei Huang, UNSW Sydney

  • Chapter 5 showed that a randomized offer can be used to recover the effect of actually taking a treatment. That offer was an instrument.
  • This chapter generalizes the idea to settings with no experiment: an outside shock that moves the treatment, but has no other route to the outcome.
  • Two case studies: Chinese import competition and US local labour markets (an instrument built from other countries’ trade), and the effect of going public on firm innovation (an instrument from stock market swings during the IPO process).

Where This Chapter Fits

NoteStep 2: Does something shift treatment but reach the outcome only through it?
  • You arrive here when: You cannot randomize, but an outside shock nudges some units into treatment (or a randomized offer was not fully taken up, Chapter 5).
  • This chapter: The IV assumptions, two-stage least squares, LATE, weak instruments, and how to defend exclusion.
  • Next: Chapter 7: when a rule assigns treatment at a cutoff. A cutoff that is not followed exactly is an instrument.

See the design flowchart in Chapter 1.

In Practice: Instrumental Variables

TipPractitioner Summary
  • Use it when: something outside the units’ control shifts treatment (a randomized offer, a rule, a market shock) and you can argue it has no other route to the outcome
  • What you need: the instrument, treatment, and outcome for the same units; outcomes from before the shock for falsification tests
  • What must hold: relevance, independence, exclusion, and monotonicity
  • Checks to run: first stage and its F-statistic; reduced form; placebo and falsification tests; a description of the compliers
  • In R: feols(y ~ x | fe | d ~ z, data), fitstat(model, ~ivf) for the first-stage F
  • Telling a manager: “We use only the part of the variation in X caused by Z, which has nothing to do with the outcome otherwise. For units whose X responds to Z, the effect is …”

From Experiments to Instruments

The Idea

NoteUsing Variation from Outside the Decision

The treatment D is chosen and therefore confounded. An instrument Z is a variable that:

  1. Moves the treatment (Z \rightarrow D)
  2. Is as good as randomly assigned with respect to the outcome
  3. Affects the outcome only through the treatment (Z \not\rightarrow Y except via D)

Z \longrightarrow D \longrightarrow Y, \qquad D \longleftarrow U \longrightarrow Y

The confounder U biases a regression of Y on D. The instrument uses only the part of the variation in D that comes from Z, which U does not touch.

Where Instruments Come From

TipExamples of Natural Instruments
Instrument Treatment it moves Outcome
Random offer in an experiment (Chapter 5) Using an AI tool Productivity
China’s export growth to other rich countries US imports from China US manufacturing jobs
Stock market swings while a firm’s IPO is pending Completing the IPO Innovation
Random assignment of cases to stricter or more lenient judges Eviction, bankruptcy relief Earnings, health, credit
Wind direction Air pollution Cognitive performance (Chapter 8)
Policy rules and eligibility thresholds Benefit receipt Labour supply

A good instrument comes with a story: why it moves treatment, and why it has no other path to the outcome.

The IV Framework

The Assumptions

ImportantFour Conditions
Assumption Meaning Testable?
Relevance Z shifts D: \text{Cov}(Z, D) \neq 0 Yes: the first stage
Independence Z is as good as random, possibly after controls Partly: balance and placebo checks
Exclusion Z affects Y only through D No: must be argued
Monotonicity Z never pushes anyone away from treatment (no defiers) Rarely; argued

Relevance is checked with data. The other three are arguments about the setting, supported by indirect evidence.

The Estimator

NoteWald Ratio and Two-Stage Least Squares

With a single instrument and no controls:

\hat\beta_{IV} = \frac{\widehat{\text{Cov}}(Y, Z)}{\widehat{\text{Cov}}(D, Z)} = \frac{\text{reduced form (effect of } Z \text{ on } Y)}{\text{first stage (effect of } Z \text{ on } D)}

Two-stage least squares (2SLS) generalizes this to controls and several instruments:

  1. First stage: regress D on Z and controls X; keep the fitted values \hat D
  2. Second stage: regress Y on \hat D and X

Use software for the second stage: running it by hand gives wrong standard errors. In R: feols(y ~ x | fe | d ~ z, data).

What IV Estimates

WarningA Local Effect, for Compliers

With heterogeneous effects and a binary treatment, IV estimates the local average treatment effect (LATE): the effect for compliers, the units whose treatment status is changed by the instrument (Imbens and Angrist 1994; Angrist et al. 1996).

  • Different instruments for the same treatment can identify different LATEs, because they shift different people
  • Compliers are often marginal units: firms that would go public in a good market but not a bad one; workers who use a tool only when nudged
  • With a continuous treatment, IV is a weighted average of marginal effects, with weights determined by the instrument

Always ask: who are the compliers, and is their effect the one the policy question needs?

Things That Go Wrong

Weak Instruments

WarningWhen the First Stage Is Small
  • A weak first stage makes the IV estimate noisy and biased towards OLS, and its usual confidence intervals are too narrow
  • It also amplifies any violation of independence or exclusion: a small direct effect of Z on Y is divided by a small first stage (Hernán and Robins 2020)
  • Rule of thumb: a first-stage F-statistic below 10 signals trouble. Recent work suggests the conventional t-test needs a much larger F (above about 100) to have its nominal size (Lee et al. 2022)
  • Responses: report the first stage prominently; use weak-instrument-robust inference (e.g., Anderson–Rubin confidence sets); prefer one strong instrument to many weak ones

Defending the Exclusion Restriction

TipIndirect Evidence for an Untestable Assumption
  • Name the alternative channels through which Z could affect Y, and rule them out one by one
  • Placebo tests: find a setting where Z varies but cannot affect D. If Z still predicts Y there, exclusion fails. Bernstein (2015) checks NASDAQ returns outside the IPO window
  • Falsification on the past: the instrument should not predict outcomes before treatment. Autor et al. (2013) check whether future import exposure predicts manufacturing changes in earlier decades
  • Over-identification tests (several instruments) can only detect instruments that disagree; they cannot validate all of them

Simulation: OLS, IV, and Weak Instruments

Code
library(fixest)
setFixest_notes(FALSE)
set.seed(2026)

simulate <- function(first_stage, n = 1000) {
  u <- rnorm(n)                                   # unobserved confounder
  z <- rnorm(n)                                   # instrument: random, no direct effect on y
  d <- first_stage * z + u + rnorm(n)             # treatment depends on z and on u
  y <- 1.0 * d + 2 * u + rnorm(n)                 # true effect of d = 1
  dat <- data.frame(y, d, z)
  c(ols = unname(coef(feols(y ~ d, dat))["d"]),
    iv  = unname(coef(feols(y ~ 1 | d ~ z, dat))["fit_d"]),
    F   = fitstat(feols(d ~ z, dat), "f")$f$stat)
}

strong <- replicate(500, simulate(first_stage = 1.0))
weak   <- replicate(500, simulate(first_stage = 0.05))

round(rbind(strong_median = apply(strong, 1, median),
            weak_median   = apply(weak, 1, median),
            weak_IQR_low  = apply(weak, 1, quantile, 0.25),
            weak_IQR_high = apply(weak, 1, quantile, 0.75)), 2)
               ols   iv      F
strong_median 1.67 1.00 499.73
weak_median   2.00 1.26   1.23
weak_IQR_low  1.98 0.27   0.38
weak_IQR_high 2.02 2.08   3.31
  • With a strong instrument, IV centres on the true effect (1) while OLS is biased upwards by the confounder.
  • With a weak instrument (first-stage F around 1), IV estimates are widely dispersed and their median drifts towards the OLS estimate.

Case Study 1: The China Syndrome

Case Study 1: Import Competition and US Jobs

NoteAutor, Dorn & Hanson (2013), American Economic Review (Autor et al. 2013)

Question: How did rising imports from China between 1990 and 2007 affect US local labour markets: manufacturing jobs, unemployment, wages, and use of government transfers?

Units: 722 commuting zones (local labour markets covering the mainland US), observed over two periods (1990–2000, 2000–2007).

Treatment: import exposure per worker. Regions differ in exposure because they specialized in different industries before China’s rise:

\Delta IPW_{it} = \sum_j \frac{L_{ijt}}{L_{ujt}} \cdot \frac{\Delta M_{jt}}{L_{it}}

National growth in Chinese imports in industry j (\Delta M_{jt}) is allocated to region i according to the region’s share of national employment in that industry, per worker.

Case Study 1: Why OLS Is Biased, and the Instrument

WarningThe Endogeneity Problem

US imports from China rise partly because US demand rises. A region with booming demand for, say, furniture sees more imports and more local furniture jobs. Demand shocks therefore push imports and employment in the same direction, making OLS understate the harm from Chinese competition.

TipThe Instrument: Other Rich Countries’ Imports from China

Replace US imports with Chinese import growth into eight other high-income countries (Australia, Denmark, Finland, Germany, Japan, New Zealand, Spain, Switzerland), allocated using ten-year-lagged US employment shares.

  • Relevance: China’s productivity gains and WTO entry raised its exports to all rich countries at once
  • Exclusion: demand shocks in Germany or Japan should not directly change employment in a US commuting zone
  • Lagged shares reduce the risk that regions’ industry mix already reflected anticipated Chinese competition

Case Study 1: Results

TipMain Findings
  • IV vs. OLS: an extra $1,000 of import exposure per worker over a decade lowers manufacturing employment by 0.60 percentage points of the working-age population (2SLS), compared with 0.17 from OLS. About a quarter of the gap reflects measurement error in regional employment; the rest is the correction for endogeneity, in the direction the demand story predicts
  • Aggregate importance: the authors’ conservative estimate, counting only the supply-driven part of Chinese imports, is that import competition explains about 21% of the decline in US manufacturing employment over 1990–2007 (“one-quarter” in the abstract)
  • Beyond manufacturing: more exposed regions see higher unemployment, lower labour force participation, lower wages, and sharp rises in transfer payments (unemployment, disability, retirement, health care)
  • Standard errors clustered by state; regressions weighted by regional population

Case Study 1: Threats and Checks

WarningCould the Instrument Fail?
  • Correlated demand shocks across rich countries (e.g., global demand for electronics): would bias estimates towards zero. The authors confirm results with a gravity-model measure of China’s supply-side gains
  • Pre-existing decline: maybe regions exposed to China were losing manufacturing anyway. Falsification: future import exposure shows little relation to manufacturing changes before the shock (a weak negative relation in the 1980s, a positive one in the 1970s)
  • Shift-share structure: the instrument combines industry shocks with regional shares. Its validity can rest on the shocks being as-good-as-random (Borusyak et al. 2022) or on the shares being exogenous (Goldsmith-Pinkham et al. 2020), two different arguments worth making explicit

Case Study 1: What to Copy

TipPractices to Reuse
  • Build the instrument from the same shock seen elsewhere. Other rich countries’ imports from China capture China’s supply push without US demand.
  • Use lagged exposure shares, so the measure does not already reflect anticipated competition.
  • Run a falsification test on the past: future exposure should not explain changes before the shock.

Case Study 1: Discussion Questions

  1. Why does the OLS estimate understate the effect? Draw the causal diagram with the demand shock.
  2. Why might Australia’s imports from China be a valid instrument for US imports from China? What would make it invalid?
  3. Why use employment shares from ten years earlier rather than at the start of each period?
  4. Who are the “compliers” when the instrument is continuous and the units are regions?
  5. The rise in disability and other transfers is part of the effect. What does that imply for evaluating trade policy?
  1. A local demand shock raises both imports and local production. It pushes imports and employment up together, hiding part of the negative effect of import competition. The diagram has demand → imports and demand → employment, alongside imports → employment.
  2. China’s productivity growth and WTO entry raised its exports to all rich countries, which moves US imports (relevance), while Australia’s demand should not affect US employment directly. It fails if demand shocks are correlated across rich countries, or if trade with Australia affects US industries directly.
  3. Shares at the start of a period may already reflect anticipated Chinese competition, as firms move out of exposed industries. Ten-year-old shares come from before that response.
  4. With a continuous instrument and continuous treatment, 2SLS averages the effects with weights that are larger where the instrument moves exposure most: regions specialized in the industries where China’s exports grew fastest.
  5. Costs go beyond lost manufacturing jobs: transfers, lower participation, and lower wages last for years. Evaluating trade policy needs to count these adjustment costs and who bears them, not only the gains to consumers.

Case Study 2: Going Public and Innovation

Case Study 2: Does Going Public Change Innovation?

NoteBernstein (2015), Journal of Finance (Bernstein 2015)

Question: When a firm goes public, does its innovation change?

The selection problem: firms that go public differ from those that stay private. Comparing firms that completed an IPO with firms that filed but withdrew helps, since both wanted to go public, but the decision to withdraw is itself a choice.

Data: innovative US firms that filed for an IPO between 1985 and 2003: 1,488 completed and 323 withdrew. Innovation measured with patents for five years after filing: number of patents (scale) and citations per patent (novelty).

Case Study 2: The Instrument

TipMarket Swings During the IPO Window

Instrument: NASDAQ returns in the two months after the IPO filing, while the firm is marketing its shares (book-building). Firms are more likely to withdraw if the market falls during this window.

First stage: a one standard deviation fall in two-month NASDAQ returns lowers the likelihood of completing the IPO by about 8.7%; first-stage F = 47.8.

Specification: filing-year and industry fixed effects, plus pre-filing innovation, so firms are compared with others filing in the same year and industry.

Exclusion argument: a two-month market swing affects five-year innovation only by changing whether the firm goes public. Placebo: NASDAQ returns outside the book-building window, when the listing decision is already fixed, do not predict innovation.

Case Study 2: Results

TipMain Findings
  • Going public causes about a 40% decline in innovation novelty (citations per patent), with no change in the number of patents: firms shift to more conventional projects
  • Inventors: key inventors are more likely to leave after the IPO, and those who stay become less productive; public firms do attract new inventors
  • Buying innovation: newly public firms acquire more companies; acquired patents make up almost a third of their patent portfolio within five years
WarningWhose Effect?

The compliers are firms whose IPO depends on market conditions during a two-month window: marginal IPO candidates. The effect for firms that would go public in any market could differ.

Case Study 2: What to Copy

TipPractices to Reuse
  • Narrow the comparison first. Comparing firms that filed for an IPO and completed it with those that withdrew removes most differences before the instrument is used.
  • Pair the instrument with a placebo window. Market returns outside book-building should not matter, and they do not.
  • Say whose effect it is: marginal IPO firms whose listing depends on market conditions.

Case Study 2: Discussion Questions

  1. Why is comparing completed with withdrawn IPO filers better than comparing public with private firms, and why is it still not enough?
  2. How could a NASDAQ fall affect long-run innovation other than through IPO completion? How does the placebo test address this?
  3. Why is the first-stage F-statistic reported, and what would you conclude if it were 4?
  4. Why might the effect on novelty differ for marginal IPO firms compared with firms that would always go public?
  1. Both groups wanted to go public, so they are more alike than public and private firms. But withdrawal is a choice that may reflect bad news about the firm’s prospects, which could also affect innovation.
  2. A market fall may signal worse investment opportunities or financing conditions that affect innovation directly, whether or not the firm lists. The placebo shows that market returns outside the book-building window, when the listing decision is already fixed, do not predict innovation.
  3. It shows the instrument moves IPO completion strongly enough for standard inference. With F = 4 the instrument would be weak: the 2SLS estimate would be biased towards OLS and its confidence intervals unreliable, so weak-instrument-robust inference would be needed and conclusions would be fragile.
  4. Marginal firms list only in good markets; they may be smaller or riskier, with innovation that depends more on private ownership. Firms that would always list may already run more conventional projects, so the change on listing could be smaller.

Comparing the Two Designs

Comparing the Two Instruments

NoteTwo Instruments Compared
Autor, Dorn & Hanson (2013) Bernstein (2015)
Treatment Import exposure (continuous) Completing an IPO (binary)
Instrument Chinese imports into other rich countries NASDAQ returns during book-building
Relevance China’s supply shock hit all rich countries Falling markets lead firms to withdraw (F = 47.8)
Exclusion threat Global demand shocks Market conditions affecting innovation directly
Key check Pre-period falsification; gravity-based measure Placebo returns outside the IPO window
Whose effect Regions, weighted by how strongly the instrument shifts their exposure Marginal IPO firms

Best Practices

IV Checklist

TipReport and Argue
  1. Tell the story of the instrument: why it moves treatment, and why it has no other path to the outcome
  2. Show the first stage (coefficient and F-statistic) and the reduced form (effect of Z on Y)
  3. Compare with OLS and explain the direction of the difference
  4. Run placebo and falsification tests for exclusion
  5. Describe the compliers: whose effect is identified?
  6. Use weak-instrument-robust inference when the first stage is not very strong

Common Pitfalls

WarningMistakes to Avoid
  • Treating a significant first stage as proof the instrument is valid (relevance is the easy part)
  • Assuming the exclusion restriction without naming alternative channels
  • Many weak instruments instead of one strong one
  • Computing the second stage by hand and reporting its standard errors
  • Interpreting the IV estimate as an average effect for everyone
  • Using a lagged value of the treatment as an instrument without a story for why it is excluded

Summary

  • An instrument shifts treatment but affects the outcome only through it; IV uses only that variation
  • Relevance is tested; independence, exclusion, and monotonicity are argued with indirect evidence
  • IV estimates a local effect for compliers
  • Weak instruments produce noisy, biased estimates with misleading confidence intervals
  • Strong IV papers combine a convincing story, a strong first stage, and careful placebo and falsification tests

Next Steps

  1. Read: Autor et al. (2013) (introduction, data and empirical strategy, main results); Bernstein (2015) (identification strategy and main results)
  2. Practice: In the simulation, add a direct effect of z on y (violating exclusion). How does the IV estimate change?
  3. Next Class: Regression discontinuity, where a rule decides treatment at a cutoff (Chapter 7)

References

Angrist, Joshua D, Guido W Imbens, and Donald B Rubin. 1996. “Identification of Causal Effects Using Instrumental Variables.” Journal of the American Statistical Association 91 (434): 444–55.
Autor, David H, David Dorn, and Gordon H Hanson. 2013. “The China Syndrome: Local Labor Market Effects of Import Competition in the United States.” American Economic Review 103 (6): 2121–68. https://doi.org/10.1257/aer.103.6.2121.
Bernstein, Shai. 2015. “Does Going Public Affect Innovation?” The Journal of Finance 70 (4): 1365–403. https://doi.org/10.1111/jofi.12275.
Borusyak, Kirill, Peter Hull, and Xavier Jaravel. 2022. “Quasi-Experimental Shift-Share Research Designs.” Review of Economic Studies 89 (1): 181–213. https://doi.org/10.1093/restud/rdab030.
Goldsmith-Pinkham, Paul, Isaac Sorkin, and Henry Swift. 2020. “Bartik Instruments: What, When, Why, and How.” American Economic Review 110 (8): 2586–624. https://doi.org/10.1257/aer.20181047.
Hernán, Miguel A., and James M. Robins. 2020. Causal Inference: What If. Chapman & Hall/CRC. https://miguelhernan.org/whatifbook.
Imbens, Guido W, and Joshua D Angrist. 1994. “Identification and Estimation of Local Average Treatment Effects.” Econometrica 62 (2): 467–75. https://doi.org/10.2307/2951620.
Lee, David S, Justin McCrary, Marcelo J Moreira, and Jack Porter. 2022. “Valid t-Ratio Inference for IV.” American Economic Review 112 (10): 3260–90. https://doi.org/10.1257/aer.20211063.