Econometrics · Chapter 10
Instrumental Variables and 2SLS
Chapter 6 left us stuck: schooling is tangled with ability, and ability is never in the data. The way out is a variable that nudges schooling but has nothing else to do with pay. The economist David Card used whether people grew up near a four-year college. Here you’ll run that idea in a world where you know the truth: watch OLS miss and two-stage least squares find the answer, then weaken the instrument until 2SLS scatters wildly, and break its key assumption to see how badly a bad instrument can mislead.
The world
Live numbers
Missions
What you’re seeing
The causal story. In this simulated world, a year of school truly raises log wages by 0.08 (about 8%). Ability (A, never observed) raises both schooling and wages, which is what fools OLS. Growing up near a college (Z) adds π years of school on average, and, as long as the red dashed arrow is absent, affects wages only through schooling. Arrow widths follow the sliders.
This sample. One data set of the size you choose: the OLS and 2SLS estimates with their 95% intervals, against the gold truth. The gauge shows the first-stage F statistic, which measures how clearly the instrument moves schooling, with marks at the classic rule of thumb (10) and at 104.7, a stricter modern threshold explained below.
Many samples. “Run 1,000 samples” redraws the world a thousand times. OLS (pink) forms a tall, narrow pile in the wrong place: precise and biased. 2SLS (green) is wider but centered on the truth when the instrument is strong and valid. Weaken or break the instrument and watch the green pile.
Endogeneity: when the regressor is tangled with the error
OLS needs the regressor to be uncorrelated with the error: Cov(x, u) = 0. A regressor that violates this is called endogenous, and OLS is then biased and inconsistent: more data won’t help. There are three classic sources:
Something in u (ability, motivation, family background) moves with x. Chapter 6.
A noisy x carries its error into u, attenuating the slope. Chapter 9.
x and y cause each other. Price and quantity are set together by supply and demand; cities with more crime hire more police.
Instruments and the IV estimator
An instrumental variable z for the endogenous x in y = β₀ + β₁x + u must satisfy two conditions:
- Relevance: Cov(z, x) ≠ 0. The instrument moves x. You can test this with the first-stage regression of x on z.
- Exogeneity (the exclusion restriction): Cov(z, u) = 0. The instrument is unrelated to everything else that drives y, and affects y only through x. With one instrument, this can’t be tested from the data; it has to be argued.
Take the covariance of both sides of the model with z: Cov(z, y) = β₁Cov(z, x) + Cov(z, u). If the last term is zero,
The Wald estimator. With a yes-or-no instrument this becomes a ratio of differences in group averages:
If growing up near a college raises wages by 2.56% and schooling by 0.32 years, and does nothing else, each year of schooling must be worth 2.56/0.32 = 8%.
If exclusion fails. With a direct effect δ of the instrument on y, the IV estimate heads to β₁ + δ/π, where π is the instrument’s effect on x. A weak instrument (small π) magnifies even a tiny violation.
David Card (1995) studied 3,010 men from the National Longitudinal Survey of Young Men, with wages measured in 1976. He used whether a man grew up near a four-year college as an instrument for his years of schooling, with controls for experience, race, region and other factors. As reported in Wooldridge’s textbook (Example 15.4):
- First stage: growing up near a college went with about 0.32 more years of school, with a t statistic of about 3.6 (so F ≈ 13).
- OLS return to a year of school: about 0.075. IV return: about 0.132, with a standard error of about 0.055, so the 95% interval runs from about 0.024 to 0.240.
Two lessons. The IV estimate is much less precise than OLS, as mission “The price of IV” shows. And it came out larger than OLS, the opposite of simple ability bias. One explanation, discussed by Card himself in a 2001 survey, is that IV measures the return for the people whose schooling the instrument moves, who may have had unusually high returns (see local average treatment effects below).
Two-stage least squares, step by step
With extra exogenous controls w, or more than one instrument, IV generalizes to two-stage least squares. Stage 1: regress the endogenous x on all instruments and all exogenous controls, and save the fitted values x̂. Stage 2: regress y on x̂ and the controls. With one instrument and one endogenous regressor, 2SLS equals the IV estimator above.
The idea: x̂ keeps only the variation in x that comes from the instrument, which is clean, and throws away the part tangled with u. Don’t compute the standard errors from the second-stage OLS output, though: its residuals use x̂ rather than x. Software that does 2SLS in one command gets them right.
Step through it
Uses the main simulation’s settings with 400 people and an instrument strength of at least 1 year.
Weak instruments
When the instrument barely moves x, the denominator Cov(z, x) is small and noisy, and 2SLS behaves badly in three ways you can see in the simulation:
- its sampling distribution is wide, with long tails: occasional estimates are far off;
- its center drifts toward the OLS estimate, so it is biased in the same direction as OLS;
- its usual standard errors and t tests can’t be trusted. In this simulation weak instruments gave intervals so wide they almost always covered the truth while telling you little; in other settings, with stronger endogeneity, they cover far less than 95%.
John Bound, David Jaeger and Regina Baker (1995) made the problem famous. They revisited a quarter-of-birth study that used many instruments, each weak, and showed that instruments made of random numbers, with no real link to schooling, produced estimates close to the original ones.
The first-stage F rule and its limits. The first-stage F statistic tests whether the excluded instruments matter in stage 1. Be careful with the famous cutoff:
- Douglas Staiger and James Stock (1997) suggested treating a first-stage F below 10 as a sign of weak instruments. This became the standard rule of thumb.
- Stock and Motohiro Yogo (2005) tabulated sharper cutoffs. With one endogenous regressor and one instrument, the F must exceed 16.38 for a nominal 5% test to reject a true hypothesis no more than 10% of the time.
- David Lee, Justin McCrary, Marcelo Moreira and Jack Porter (2022) showed that with one instrument, the usual 5% t test only has a true 5% size if F exceeds 104.7, unless you use their adjusted critical values.
- With heteroskedastic or clustered errors, the classic F is the wrong measure; use the “effective F” of José Luis Montiel Olea and Carolin Pflueger (2013). The Anderson–Rubin test (1949) stays valid however weak the instrument.
Suppose growing up near a college also raises wages directly by 1% (δ = 0.01), perhaps because colleges are in cities with higher pay. With a strong instrument, π = 1 year, 2SLS heads to 0.08 + 0.01/1 = 0.09: off by 0.01. With π = 0.2 years, it heads to 0.08 + 0.01/0.2 = 0.13, off by 0.05, worse than OLS in this world. The “Small leak, weak pipe” mission shows exactly this.
A strong first stage proves relevance, nothing more. Exogeneity is a separate claim that the first stage can’t check. In the “Invalid” world the first-stage F is about 50, and 2SLS still misses by more than OLS. The second mistake is the reverse: thinking any instrument beats OLS. A weak or slightly invalid instrument can produce an estimate that is both noisier and more biased than the OLS it replaced.
More instruments, endogeneity tests and overidentification
Testing for endogeneity. If x is in fact exogenous, OLS and 2SLS estimate the same thing and OLS is more precise. A Hausman-type test compares them. The regression version: add the first-stage residual v̂ to the structural equation; if its coefficient is significant, x is endogenous.
Overidentification. With more instruments than endogenous regressors, each instrument alone would give its own IV estimate; if all are valid, they should agree up to sampling error. The Sargan test (1958), or Hansen’s J test (1982) with robust errors, regresses the 2SLS residuals on all exogenous variables: n·R² is χ² with (number of instruments − number of endogenous regressors) degrees of freedom. Passing doesn’t prove validity: if all the instruments are wrong in the same way, they will still agree.
A first look at local average treatment effects
So far the effect of school was the same for everyone. If effects differ across people, what does IV estimate? Guido Imbens and Joshua Angrist (1994) gave the answer for a yes-or-no instrument and treatment. Sort people by how their treatment responds to the instrument:
| Type | Treated if z = 0? | Treated if z = 1? | Example (college near home) |
|---|---|---|---|
| Always-takers | yes | yes | go to college wherever they live |
| Never-takers | no | no | never go, wherever they live |
| Compliers | no | yes | go only if a college is close by |
| Defiers | yes | no | go only if a college is not close (assumed not to exist) |
The instrument changes the treatment only for compliers. With a valid instrument and no defiers (“monotonicity”), the Wald ratio equals the local average treatment effect (LATE): the average effect for compliers. It is not the average effect for everyone. That is why different valid instruments can give different answers: each one has its own compliers.
In Card’s data the compliers are people who went further in school because a college was nearby. If they came from families with fewer resources, and gained more from extra schooling, the LATE can exceed the average return in the population: one explanation for IV coming out above OLS.
A short history and famous studies
Origins. The first instrumental-variables estimator appeared in 1928, in Appendix B of Philip G. Wright’s book The Tariff on Animal and Vegetable Oils, to estimate supply and demand curves for butter and flaxseed. Whether Philip or his son, the geneticist Sewall Wright, wrote the appendix was debated; James Stock and Francesco Trebbi (2003) used the writing style to argue that Philip did. Olav Reiersøl and R. C. Geary developed the method in the 1940s; Henri Theil and Robert Basmann introduced two-stage least squares in the 1950s, and Denis Sargan his overidentification test in 1958.
Quarter of birth. Joshua Angrist and Alan Krueger (1991) noticed that U.S. compulsory-schooling laws let students leave at a fixed age, usually 16. Children born early in the year start school older, so they reach that age having completed slightly less school. Using hundreds of thousands of men from the 1970 and 1980 censuses, they found small differences in schooling by quarter of birth and IV returns to schooling close to the OLS ones. Bound, Jaeger and Baker’s 1995 critique of the many-instrument versions launched the weak-instruments literature.
College proximity. David Card’s 1995 study, described above, became a standard textbook example, with its data distributed with Wooldridge’s textbook.
Recognition. The 2021 Nobel memorial prize in economics went half to David Card and half jointly to Joshua Angrist and Guido Imbens, the latter two for their methodological contributions to the analysis of causal relationships, including the LATE framework.
Where it shows up
Demand and pricing. Price and quantity are set together, so regressing quantity on price mixes supply and demand. Wright’s fix was to find a supply shifter that doesn’t shift demand. In a well-known study of New York’s Fulton Fish Market, Joshua Angrist, Kathryn Graddy and Guido Imbens (2000) used stormy weather at sea, which cuts the catch, as an instrument for the price of fish.
Experiments with imperfect compliance. When a company randomly offers a new feature or discount and only some customers take it, the random offer is a perfect instrument for actually using it, and the Wald ratio gives the effect on compliers. Lottery-based studies use the same logic, such as Angrist’s 1990 study of the Vietnam-era draft lottery.
Health. Mark McClellan, Barbara McNeil and Joseph Newhouse (1994) used how much closer a heart-attack patient lived to a hospital offering intensive treatment as an instrument for receiving it.
Policy. Rainfall for farm income, distance for access, judges’ assignment for sentences, birth timing for schooling: much of modern applied economics is the search for credible instruments, and the debate over whether each one truly satisfies the exclusion restriction.
Practice
Warm-up People who won a scholarship lottery got on average 0.5 more years of school and earn 4% more than lottery losers. If the lottery affects earnings only through schooling, what is the implied return to a year of school?
Show the answer
Wald ratio: 0.04/0.5 = 0.08, or 8% per year, for the people whose schooling the lottery changed.
Warm-up Which condition for a valid instrument can you test with a regression, and which can’t you?
Show the answer
Relevance (Cov(z, x) ≠ 0) is tested with the first stage. Exogeneity (Cov(z, u) = 0) can’t be tested with a single instrument; it rests on argument and institutional knowledge.
Core A first-stage regression with one instrument gives π̂ = 0.25 with a standard error of 0.10. What is the first-stage F? Is the instrument weak by the rule of thumb? By the Stock–Yogo 10% size criterion?
Show the answer
With one instrument F = t² = (0.25/0.10)² = 6.25. That is below 10, so weak by the rule of thumb, and well below Stock and Yogo’s 16.38. Report weak-instrument-robust inference such as an Anderson–Rubin interval.
Core The instrument raises the treatment by π = 0.4 and has a small direct effect on the outcome of δ = 0.02. The true effect is 0.10. Where does the IV estimate head in large samples? What if π = 0.1?
Show the answer
β₁ + δ/π = 0.10 + 0.02/0.4 = 0.15. With π = 0.1: 0.10 + 0.2 = 0.30, three times the truth.
Core A company randomly emails a discount code to half its customers. 30% of those emailed use the code, and 2% of the others use it anyway (shared codes). Average spending is $4.20 higher in the emailed group. What is the effect of using the code, and for whom?
Show the answer
Wald: $4.20 / (0.30 − 0.02) = $4.20 / 0.28 = $15.00 per user. It is the average effect for compliers: customers who used the code because they were emailed. The 2% who use it either way are always-takers.
Challenge Show that the IV estimator with a single binary instrument equals the Wald ratio (ȳ₁ − ȳ₀)/(x̄₁ − x̄₀).
Show the answer
Let n₁ observations have z = 1 and n₀ have z = 0, with p = n₁/n. Then Σ(zi − z̄)(yi − ȳ) = Σ(zi − p)yi = (1 − p)n₁ȳ₁ − pn₀ȳ₀ = np(1 − p)(ȳ₁ − ȳ₀), using n₁ = np and n₀ = n(1 − p). The same steps give np(1 − p)(x̄₁ − x̄₀) for the denominator. The common factor cancels.
Challenge You run 2SLS by hand: regress x on z, save x̂, regress y on x̂. The slope is right. Why is the reported standard error wrong, and how do you fix it?
Show the answer
The second-stage OLS computes σ̂² from y − β̂₀ − β̂₁x̂. The structural error is y − β₀ − β₁x, so σ̂² should use x, not x̂. Recompute σ̂² with x and use Var(β̂₁) = σ̂²/[SSTx R²x,z], or simply use a 2SLS command. In the step-by-step demo the by-hand standard error is noticeably off.
How the interactive works
The world. Half the people grew up near a college (Z = 1). Ability a is standard normal. Schooling = 12.5 + πZ + γa + 1.5v. Log wage = 1.2 + 0.08·schooling + 0.15a + δZ + 0.25u, with u and v standard normal. The data are simulated with a known truth; the numbers are chosen to resemble a study like Card’s (a first stage of about 0.32 years with 3,000 people gives a first-stage F near 20), not taken from it. In this world OLS heads to 0.08 + 0.15γ/Var(schooling) and 2SLS to 0.08 + δ/π.
The estimates. OLS, IV (2SLS) and the first-stage F use the textbook formulas with homoskedastic standard errors and 95% intervals of ±1.96 standard errors. The step-by-step demo uses the shared statistics library’s two-stage least squares on 400 people, with an instrument strength of at least 1 year so each step is visible.
How it was checked (node tests, 2,000 samples per case, all passed):
- OLS, the 2SLS coefficient and standard error, the first-stage F, the Wald ratio and the by-hand two-step slope all matched the shared library’s 2SLS to 5 × 10⁻¹¹.
- Strong instrument (π = 1, n = 3,000): 2SLS median 0.0798, OLS median 0.1257 (formula 0.1257); 2SLS intervals covered 95.3%, OLS ones 0%.
- Card-like (π = 0.32): 2SLS median 0.0793, F > 10 in 91.5% of samples, coverage 96.6%. Weak (π = 0.1): median F 2.1, 2SLS median 0.0887 with an interquartile range of 0.149 (OLS: 0.0036). Very weak (π = 0.05): median 0.112, two-thirds of the way to OLS.
- Invalid (δ = 0.03, π = 0.5): 2SLS median 0.1402 against the formula’s 0.1400, with 17.8% coverage despite a median F of 51.
Check yourself
A valid instrument must be…
Show the answer
Relevance and exogeneity. It will be correlated with the outcome too, but only through the regressor.
Living near a college raises schooling by 0.4 years and log wages by 0.03. The IV estimate of the return to schooling is…
Show the answer
0.03/0.4 = 0.075.
With a weak instrument, 2SLS estimates tend to be…
Show the answer
A small, noisy first stage makes 2SLS imprecise, and in finite samples its center is pulled toward the OLS estimate.
The first-stage F is 45. What can you conclude?
Show the answer
F speaks only to relevance. (For a 5% t test to be exactly 5% with one instrument, Lee and coauthors put the bar at 104.7.)
With heterogeneous effects, a binary instrument and no defiers, IV estimates…
Show the answer
The local average treatment effect: the instrument only changes compliers’ treatment, so only their effect shows up in the Wald ratio.
OLS and 2SLS give nearly the same estimate, but 2SLS has a standard error five times larger. If you are confident the regressor is exogenous, which should you report?
Show the answer
IV buys consistency under endogeneity at a big cost in precision. If the regressor is exogenous, OLS is better.
Sources
- J. M. Wooldridge, Introductory Econometrics: A Modern Approach, 7th ed. (Cengage, 2020), Chapter 15 (Instrumental Variables Estimation and Two-Stage Least Squares), including Example 15.4 on college proximity, testing for endogeneity and overidentifying restrictions.
- J. H. Stock and M. W. Watson, Introduction to Econometrics, 4th ed. (Pearson, 2019), Chapter 12 (Instrumental Variables Regression).
- J. D. Angrist and J.-S. Pischke, Mostly Harmless Econometrics (Princeton University Press, 2009), Chapter 4 (Instrumental Variables in Action), including the LATE theorem and weak instruments.
- MIT OpenCourseWare, 14.387 Applied Econometrics: Mostly Harmless Big Data (Fall 2014).
- D. Card, “Using Geographic Variation in College Proximity to Estimate the Return to Schooling,” in L. N. Christofides, E. K. Grant and R. Swidinsky, eds., Aspects of Labour Market Behaviour: Essays in Honour of John Vanderkamp (University of Toronto Press, 1995). D. Card, “Estimating the Return to Schooling: Progress on Some Persistent Econometric Problems,” Econometrica 69(5), 2001, 1127–1160.
- J. D. Angrist and A. B. Krueger, “Does Compulsory School Attendance Affect Schooling and Earnings?” Quarterly Journal of Economics 106(4), 1991, 979–1014. J. Bound, D. A. Jaeger and R. M. Baker, “Problems with Instrumental Variables Estimation When the Correlation Between the Instruments and the Endogenous Explanatory Variable Is Weak,” Journal of the American Statistical Association 90, 1995, 443–450.
- D. Staiger and J. H. Stock, “Instrumental Variables Regression with Weak Instruments,” Econometrica 65(3), 1997, 557–586. J. H. Stock and M. Yogo, “Testing for Weak Instruments in Linear IV Regression,” in D. W. K. Andrews and J. H. Stock, eds., Identification and Inference for Econometric Models (Cambridge University Press, 2005). D. S. Lee, J. McCrary, M. J. Moreira and J. Porter, “Valid t-Ratio Inference for IV,” American Economic Review 112(10), 2022, 3260–3290. J. L. Montiel Olea and C. Pflueger, “A Robust Test for Weak Instruments,” Journal of Business & Economic Statistics 31(3), 2013, 358–369.
- G. W. Imbens and J. D. Angrist, “Identification and Estimation of Local Average Treatment Effects,” Econometrica 62(2), 1994, 467–475. J. H. Stock and F. Trebbi, “Who Invented Instrumental Variable Regression?” Journal of Economic Perspectives 17(3), 2003, 177–194.