EconStatsCraft › Instrumental variables (2SLS)

Instrumental variables (2SLS)

Two-stage least squares. Reports the first stage, the weak-instrument F, the Wu–Hausman endogeneity test and the Sargan over-identification test.

What it needs

The intuition

You want the effect of schooling on wages, but people who choose more schooling differ in unobserved ways. An instrument is a lever that pushes schooling around for reasons unrelated to those unobservables - proximity to a college, a birth date that changes compulsory-schooling exposure. Use ONLY the variation the lever creates, and the confounding is left behind with the variation you discarded.

When to use it

Simultaneity (price and quantity determined together), omitted variables (ability affecting both schooling and wages), or measurement error in a regressor.

Where the estimator comes from

OLS solves E[x(y-x'\beta)]=0, which fails when E[xu]\ne 0. IV replaces it with the moment condition E[z(y-x'\beta)]=0, giving \hat{\beta}=(Z'X)^{-1}Z'y when instruments and regressors are equal in number. With more instruments, 2SLS projects X onto Z: \hat{\beta}=(\hat{X}'\hat{X})^{-1}\hat{X}'y with \hat{X}=P_Z X. Crucially the variance uses \hat{\sigma}^2(\hat{X}'\hat{X})^{-1} where \hat{\sigma}^2 comes from residuals computed with the ACTUAL X - which is exactly why running two OLS regressions by hand gives the wrong standard errors.

The model

\hat{\boldsymbol{\beta}}_{\text{2SLS}}=(\hat{\mathbf{X}}^{\prime}\hat{\mathbf{X}})^{-1}\hat{\mathbf{X}}^{\prime}\mathbf{y},\qquad \hat{\mathbf{X}}=\mathbf{P}_{\mathbf{Z}}\mathbf{X}=\mathbf{Z}(\mathbf{Z}^{\prime}\mathbf{Z})^{-1}\mathbf{Z}^{\prime}\mathbf{X}

What it assumes

Statistical properties

How to read the output

A worked reading

OLS puts the return to schooling at 0.2072; 2SLS, instrumenting with proximity to a college, puts it at 0.0924 (SE 0.0257). The first-stage F is 144.84 on (1, 896), far above the rule-of-thumb 10, and the Wu-Hausman test rejects exogeneity at F = 28.16. So OLS is more than twice the instrumented estimate - the direction omitted ability predicts, and a larger gap than most published applications find. The first stage is what makes the second stage readable: with a weak instrument the 2SLS estimate is biased towards OLS and its confidence interval is not to be trusted at all, which is why the F is reported before the coefficient rather than after it.

Symptom → diagnosis → what to do

If you see thisIt meansDo this
First-stage F < 10Weak instrumentsFind stronger ones, or report Anderson–Rubin confidence sets
2SLS ≈ OLS and Wu–Hausman does not rejectEndogeneity may be minorOLS is defensible and more efficient - but the test has low power
2SLS enormous with huge SEsWeak instrument dividing by nearly zeroDo not report it as a point estimate
Sargan rejectsAt least one instrument violates exclusionDrop the suspect one and re-test
Multiple endogenous regressorsPer-equation F is the wrong testUse Cragg–Donald / Kleibergen–Paap with Stock–Yogo values
Instrument plausibly affects y directlyExclusion failsNo statistic can fix this - argue it or abandon it

Common mistakes

Where to read this properly

See also

RD is IV with the discontinuity as the instrument; DiD is a different strategy for the same identification problem.

Related Causal

Spatial autocorrelation · Spatial regression · Heckman selection · Difference-in-differences · Staggered difference-in-differences · Regression discontinuity · Matching & weighting · Oaxaca–Blinder decomposition

All analyses

Charts

Line chart · Area chart · Bar chart · Stacked bar · Scatter plot · Bubble chart · Histogram · Box plot · Pie chart · Heat map · Rebased to 100 · Lorenz curve and Gini

Maps

World map · Bivariate map · Flow map · India - state map · India - district map

Explore

Descriptive statistics · Summary by group · Two-way table · Classical statistical tests

Regression

Multiple regression (OLS) · Logit / Probit · Tobit (censored) · Truncated regression · Multinomial logit · Ordered logit / probit · Quantile regression · Poisson / Negative binomial

Time series - one series

Time-varying coefficients (Kalman) · Unit root tests · Correlogram (ACF / PACF) · ARIMA / SARIMA · Rolling-origin cross-validation · Theta method · Unobserved components · STL forecasting · Forecast combination · Markov regime switching · Change frequency (resample) · ARCH / GARCH volatility · Decompose & filter · Spectral analysis · Exponential smoothing · Forecast accuracy

Time series - several series

Yield curve (Nelson–Siegel / Svensson) · Dynamic factor model · Dynamic regression (ARIMAX) · Structural VAR · VAR · Granger causality · Cointegration · VECM · ARDL & bounds test

Panel data

Panel regression · Panel cointegration tests · Heterogeneous panel: Mean Group & PMG · Gravity model of trade · Dynamic panel GMM · Panel diagnostics · Panel unit-root tests

Multivariate statistics

Principal components (PCA) · Factor analysis · Cluster analysis

Marketing research

Conjoint analysis · MaxDiff (best–worst scaling) · TURF - reach of a product line · Price sensitivity (Van Westendorp) · Market basket analysis · Perceptual map · Scale reliability (Cronbach’s alpha) · Key driver analysis

Causal

Spatial autocorrelation · Spatial regression · Heckman selection · Instrumental variables (2SLS) · Difference-in-differences · Staggered difference-in-differences · Regression discontinuity · Matching & weighting · Oaxaca–Blinder decomposition

Finance & risk

Black–Scholes option pricing · Bond price, duration & convexity · Merton distance to default · EMI / home loan planner · CAPM / beta estimation · Multi-factor model · Portfolio optimization · Value at Risk & Expected Shortfall · Performance & drawdown · Time value of money & NPV/IRR · Equity valuation (DDM, FCF, residual income) · Cost of capital (WACC) · Binomial option pricing · Option strategies (payoff & profit) · Forwards, futures & swaps · Credit risk & Basel capital · Extreme value theory (tail risk)

Actuarial

Life table · Life annuity · Life insurance pricing · Chain ladder reserving · Buhlmann credibility · Survival analysis · Mortality graduation · Aggregate loss model · Ruin probability · Multi-state Markov model · Loss severity fitting

Tests & breaks

Monte Carlo experiment · F-test, Wald & Chow · Structural breaks & stability

Machine learning

Regression vs machine learning · Ridge / Lasso / Elastic Net · Random forest · Gradient boosting

Open the workspace →

Starting engine…

EconStatsCraft rigorous, plain-spoken econometrics

Econometrics that explains itself.

Regression, panel data, time series and the whole battery of tests. Every result is followed by a verdict you can defend.

Load a dataset to see it here.