Enter Values

OLS coefficient estimate
Standard error of OLS estimate
IV/2SLS coefficient estimate
Standard error of IV/2SLS estimate
Partial F-stat on excluded instruments (not overall model F)
Total observations
Regressors (including endogenous, excluding intercept)
Instruments not in the structural equation
t-stat on v̂ in augmented regression (df = n - k - 2)
n × R² from 2SLS residual regression (overid test)
IV Estimation Formulas
IV = Cov(z, y) / Cov(z, x)
Simple IV, just-identified, no additional controls
z = instrument | x = endogenous variable | y = dependent variable

CI: b̂ ± tα/2, df × SE
df = n - k - 1 | Heuristic benchmark: F > 10
Ryan O'Connell, CFA
Calculator by Ryan O'Connell, CFA

Estimation Results

OLS Estimate -- --
IV/2SLS Estimate -- --
CI may be unreliable with weak instruments
Difference (IV − OLS): --

Diagnostic Tests

Weak Instrument Test
--
DWH Endogeneity Test
--
Overidentification Test (Sargan)
--

Coefficient Comparison

First-Stage F-statistic

Step-by-Step Calculation

CI: b̂ ± tα/2, n-k-1 × SE

Model Assumptions

Assumptions
  • Random sampling / i.i.d.: Observations are independently and identically distributed
  • Instrument relevance: Cov(z, x) ≠ 0 — tested by the first-stage partial F-statistic on excluded instruments
  • Instrument exogeneity: Cov(z, u) = 0 — untestable with exact identification (q = 1); testable via Sargan J-test when overidentified (q > 1)
  • Exclusion restriction: The instrument z affects y only through the endogenous variable x
  • Homoskedasticity: Standard 2SLS standard errors assume homoskedastic errors; robust SEs require separate computation
Properties
  • LATE: Under heterogeneous treatment effects, IV estimates the local average treatment effect (LATE) for compliers, not the population average
  • Efficiency trade-off: 2SLS SEs are typically larger than OLS; if no endogeneity is present, OLS is more efficient
For educational purposes. Not financial advice. Market conventions simplified.

Understanding Instrumental Variables & 2SLS

What is Endogeneity?

Endogeneity occurs when an explanatory variable in a regression model is correlated with the error term, violating a key OLS assumption. This leads to biased and inconsistent OLS estimates. Common causes include omitted variable bias, simultaneity, and measurement error.

How Does IV/2SLS Solve This?

Instrumental variables (IV) estimation addresses endogeneity by finding a variable (the instrument) that is correlated with the endogenous regressor but uncorrelated with the error term. For the simple just-identified case with one endogenous variable, one instrument, and no additional controls, the IV estimator is b̂IV = Cov(z,y) / Cov(z,x). With controls or multiple instruments, two-stage least squares (2SLS) generalizes this in two steps:

Stage 1: First Stage

Regress the endogenous variable (x) on all instruments (z) and all included exogenous controls (w). Save the fitted values x̂.

Stage 2: Second Stage

Replace the endogenous x with x̂ in the structural equation (keeping the same exogenous controls) and estimate by OLS. Note: the standard errors must be adjusted — naive OLS SEs from this second-stage regression are incorrect.

When to Use OLS vs IV

The choice depends on two diagnostic tests:

  • Weak instrument test (F > 10): If the first-stage F-statistic is below 10, instruments are weak and IV estimates are unreliable. Find stronger instruments.
  • DWH test: If the DWH test rejects, there is evidence of endogeneity and IV/2SLS is preferred. If it fails to reject, OLS is preferred on efficiency grounds, though failure to reject is not proof of exogeneity.
Key insight: IV/2SLS standard errors are typically larger than OLS. If endogeneity is not present, OLS is preferred because it is more efficient (tighter confidence intervals).

Related Topics

Frequently Asked Questions

Endogeneity occurs when an explanatory variable is correlated with the error term in a regression model. This violates the key OLS assumption that regressors are uncorrelated with the error, leading to biased and inconsistent coefficient estimates. Common causes include omitted variable bias (a relevant variable left out of the model that is correlated with both the included regressor and the dependent variable), simultaneity (when x affects y and y also affects x), and measurement error in the explanatory variable.

An instrumental variable (IV) is a variable that satisfies two conditions: relevance (it must be correlated with the endogenous explanatory variable) and exogeneity (it must be uncorrelated with the error term in the structural equation). For example, in studying the effect of education on earnings, quarter of birth has been used as an instrument because it affects years of schooling (through compulsory schooling laws) but should not directly affect earnings.

Two-stage least squares works in two steps. In the first stage, the endogenous variable is regressed on all instruments and all included exogenous controls to produce fitted values that capture only the variation in x driven by the instruments. In the second stage, the structural equation is estimated using these fitted values in place of the endogenous variable, with the same exogenous controls included. Important: the standard errors from naively running OLS in the second stage are incorrect; proper 2SLS software adjusts the variance-covariance matrix to account for the generated regressor.

A good instrument must satisfy two conditions: relevance (strong correlation with the endogenous variable, testable via the first-stage partial F-statistic on excluded instruments) and exogeneity (the instrument must be uncorrelated with the structural error term, meaning it affects y only through x). The exogeneity/exclusion restriction cannot be directly tested with exact identification (one instrument for one endogenous variable), making it crucial to provide a convincing economic argument. With multiple instruments (overidentification), the Sargan J-test can partially assess instrument validity. The F > 10 heuristic is a benchmark, not a formal test.

Weak instruments are instruments that are only weakly correlated with the endogenous variable. When instruments are weak (first-stage partial F below 10), 2SLS estimates can be severely biased toward OLS, standard confidence intervals become unreliable, and hypothesis tests can be misleading. The Stock and Yogo (2005) F > 10 heuristic is widely used as a benchmark for one endogenous regressor under homoskedasticity. With weak instruments, it is generally better to find stronger instruments rather than proceed with unreliable IV estimation.

The Durbin-Wu-Hausman (DWH) test checks for endogeneity using the augmented regression approach. First, regress the endogenous variable x on all instruments and exogenous controls, and save the residuals v̂. Then add v̂ to the structural OLS equation as an additional regressor: y = b0 + b1*x + b2*w + δ*v̂ + error. Test H0: δ = 0 using a t-test (with df = n - k - 2 for the augmented regression). If δ is statistically significant, there is evidence of endogeneity and IV/2SLS is preferred. If not significant, OLS is preferred on efficiency grounds — but note that failure to reject is not proof of exogeneity; it may reflect insufficient power.
Disclaimer

This calculator is for educational purposes only and assumes standard 2SLS with homoskedastic errors. Actual IV estimation may require robust standard errors, additional diagnostic tests, and careful consideration of instrument validity. Results should be verified with statistical software. This tool should not be used as the sole basis for empirical research conclusions.