Endogeneity, instrumental variables and 2SLS

"Your results may suffer from endogeneity" is the most common examiner and reviewer comment in applied economics. Here's what it means, how instrumental variables fix it, and which tests prove your instruments work.

2 min readReviewed 2026-11-25Stata · R
M

Made for: Master's dissertation student

Your data is ready. The model isn't cooperating.

Sound familiar?

  • The Hausman test says one thing and your supervisor says another
  • Stata or EViews throws errors you can't decode at 1 a.m.
  • You're not sure your results are even the right ones to report
  • The deadline is fixed, and your supervisor has 20 other students

We diagnose your model, run it with you, and explain every number so you can defend it.

What is endogeneity?

A regressor is endogenous when it is correlated with the error term. OLS is then biased and inconsistent. Three usual sources:

  1. Omitted variables: ability drives both education and wages.
  2. Reverse causality (simultaneity): governance affects firm performance, and performance affects governance.
  3. Measurement error in the regressor.

How IV works

An instrument Z must satisfy two conditions:

  • Relevance: Z is correlated with the endogenous regressor X. This is testable.
  • Exogeneity (exclusion): Z affects Y only through X, and is uncorrelated with the error. This is mostly argued, not tested.

Two-stage least squares (2SLS): stage 1 regresses X on Z (and controls); stage 2 regresses Y on the predicted X̂.

Classic examples: rainfall as an instrument for agricultural income; distance to college for education; lagged or industry-average values in corporate finance (debated); settler mortality for institutions (Acemoglu, Johnson & Robinson, 2001).

Step by step

* Stata
ivregress 2sls y controls (x = z1 z2), vce(robust) first
estat firststage          // first-stage F and weak-instrument tests
estat overid              // overidentification (needs more instruments than endogenous vars)
estat endogenous          // Durbin-Wu-Hausman: is X actually endogenous?
* With fixed effects: xtivreg, or ivreg2 / xtivreg2 (user-written)
library(fixest)
iv <- feols(y ~ controls | x ~ z1 + z2, data = df, vcov = "hetero")
fitstat(iv, ~ ivf + ivwald + sargan + wh)

The tests to report

Test Null You want Guideline
First-stage F Instruments irrelevant Reject F > 10 (Staiger & Stock, 1997); compare with Stock-Yogo critical values; with robust SEs use the effective F (Montiel Olea & Pflueger)
Overidentification (Sargan/Hansen J) Instruments valid Don't reject Only possible with more instruments than endogenous regressors
Endogeneity (Durbin-Wu-Hausman) X is exogenous Reject, to justify IV If not rejected, OLS is consistent and more efficient

How to report it

Example: To address reverse causality between board independence and ROA, we instrument board independence with the industry-average board independence of other firms and the 2016 governance code dummy. The first-stage F-statistic is 23.4, above the Stock-Yogo 10% critical value. The Hansen J test does not reject instrument validity (p = .41), and the Durbin-Wu-Hausman test confirms endogeneity (p = .03). The 2SLS estimate is 0.21 (p < .05), larger than OLS.

Common mistakes

  • Weak instruments. With F < 10, 2SLS is biased towards OLS and inference is unreliable.
  • Asserting exogeneity without arguing it. Explain why Z affects Y only through X.
  • Too many instruments relative to the sample.
  • Using the lagged endogenous variable as an instrument without discussing persistence and serial correlation.
  • Manually running two OLS stages: the second-stage standard errors are wrong. Use ivregress.

Frequently asked questions

I can't find a good instrument. What else can I do?

Options include panel fixed effects (removes time-invariant omitted variables), system GMM with internal instruments, Difference-in-differences around a policy change, the Gaussian copula approach (common in management) or a sensitivity analysis. Be honest about the limitation.

Is GMM the same as IV?

GMM generalises IV. In panels, Arellano-Bond and Blundell-Bond GMM use lags as instruments. See our GMM guide.