In the lecture we took Angrist & Krueger's quarter-of-birth instrument at face value. Now we stress-test it. The exclusion restriction cannot be tested — but you can work out how much damage a violation would do if there were one. That calculation is what separates a careful reader of IV papers from a credulous one.
pacman::p_load(tidyverse, estimatr, ivreg, modelsummary, masteringmetrics)
data("ak91", package = "masteringmetrics")
first_stage <- lm_robust(s ~ qob, data = ak91) # instrument -> treatment
reduced_form <- lm_robust(lnw ~ qob, data = ak91) # instrument -> outcome
pacman::p_load(...) run without red errors?
ivreg is new this week — if it is missing, run
install.packages("ivreg") once.data() can't find ak91? It ships inside
masteringmetrics — see About &
setup.How hard does the instrument actually push? Extract the first-stage coefficient \(\phi\).
\(\phi\) = years of schooling.
Expressed in days (\(\phi \times 365\)), being born one quarter later buys roughly days of extra education.
phi <- coef(first_stage)["qob"]
phi
phi * 365 # in days
The amplification factor. The Wald estimator divides by \(\phi\), so anything contaminating the reduced form gets multiplied by \(1/\phi\).
\(1/\phi\) =
Now put a number on the damage. Suppose — hypothetically — that quarter of birth had a tiny direct effect on log wages of 0.001, i.e. one tenth of one percent, quite apart from schooling. That is far too small to notice in any table.
The resulting bias in the IV estimate is \(0.001 / \phi\) = .
As a share of the IV estimate of 0.099, that is about of the whole result.
violation <- 0.001 # a 0.1% direct effect on wages
bias <- violation / phi # amplified by 1/phi
bias
bias / (coef(reduced_form)["qob"] / phi) # as a share of the estimate
An effect you could never detect — one tenth of a percent — moves the headline number by a fifth. That is what "weak instrument" really means: not merely imprecise, but fragile.
# comment
explaining, to someone who has not taken this course, why a small first
stage is dangerous. Then compare:An instrumental-variables estimate is a ratio: the effect of the instrument on the outcome, divided by its effect on the treatment. When the instrument barely moves the treatment, that denominator is tiny — so the division blows up everything in the numerator, including any bias. Quarter of birth shifts schooling by about nineteen days, so any direct effect of birth timing on wages is magnified roughly twentyfold. A violation far too small to detect can still dominate the answer.
qob as continuous (1, 2, 3, 4), build a
dummy for being born in the fourth quarter and redo the
Wald ratio.ak91 %>% mutate(q4 = if_else(qob == 4, 1, 0)), then a
first stage and reduced form on q4.
ak91 <- ak91 %>% mutate(q4 = if_else(qob == 4, 1, 0))
phi_q4 <- coef(lm_robust(s ~ q4, data = ak91))["q4"]
rho_q4 <- coef(lm_robust(lnw ~ q4, data = ak91))["q4"]
rho_q4 / phi_q4
The Q4-dummy Wald estimate is , against 0.099 for the continuous version — a difference of several percentage points from the same data and the same idea. What does that tell you?
ivreg() to
run 2SLS with year-of-birth controls (factor(yob) on both
sides of the |). Does controlling for birth cohort change
the estimate?ak91 <- ak91 %>% mutate(yob_f = factor(yob))
iv_controls <- ivreg(lnw ~ s + yob_f | qob + yob_f, data = ak91)
modelsummary(list("2SLS + cohort controls" = iv_controls),
coef_map = c("s" = "Years of schooling"),
stars = TRUE, gof_map = c("nobs"), output = "kableExtra")
The estimate moves only a little — but note that this is something the Wald ratio simply cannot do. Adding controls is exactly why 2SLS exists.
Discuss with your neighbour. You now have two separate worries about this famous study.