FreeStatisticalTools.com
Econometrics and time series

Instrumental Variables (2SLS) Regression

Estimate a regression with endogenous regressors using instruments. You get 2SLS estimates next to OLS, first-stage strength (F and partial R²), the Sargan test of over-identifying restrictions and the Wu-Hausman test of endogeneity.

Free · No sign-upReplaces Stata ivregressWorks with your data
Updated · By Bibin Xavier

Data 500 × 11

Paste from Excel, or drop a CSV, TSV or Excel file here.
Example data 500 rows, 11 variables. Data stays in this browser tab.
IDnumericLog_WagenumericEducationnumericExperiencenumericFemalenumeric · codedUnionnumeric · codedDistance_CollegenumericFather_EducnumericEmployednumeric · codedDoctor_VisitsnumericAgenumeric
12.47120005.790118
21.83142101091041
32.561112000120029
42.0210140027.2130030
51.7512211121.691139
62.73101000091026
71.5411141013.8100031
81.46119117.281226

Variables and options

Endogenous regressors 1 selected · min 1
Exogenous controls 2 selected
Excluded instruments 2 selected · min 1
Results update automatically when you change an option.

Results

500 rows · example data
Table 1

2SLS estimates (Conventional standard errors)

Variable2SLS coefficientSEtp95% CIOLS coefficientOLS SE
Constant1.04110.37052.810.005[0.3131, 1.7691]0.85570.1685
Experience0.02220.00356.390< .001[0.0154, 0.0290]0.02200.0035
Female-0.19890.0515-3.864< .001[-0.3001, -0.0978]-0.19920.0514
Education (endogenous)0.09200.03102.965.003[0.0310, 0.1530]0.10780.0134

Note. Instruments: Distance_College, Father_Educ. N = 500.

Table 2

First-stage diagnostics

Endogenous regressorF (excluded instruments)pPartial R²Strength
EducationF(2, 495) = 56.42< .001.186Strong (F ≥ 10)

Note. The rule of thumb F ≥ 10 follows Staiger and Stock (1997); see Stock and Yogo (2005) for exact critical values.

Table 3

Specification tests

TestNull hypothesisStatisticp
Wu-HausmanRegressors are exogenous (OLS is consistent)F(1, 495) = 0.325.569
SarganInstruments are valid (over-identifying restrictions hold)χ²(1) = 0.013.910

Interpretation

The 2SLS estimate for Education is 0.092 (OLS: 0.108). The instruments are strong. The Wu-Hausman test does not reject exogeneity, so OLS would be consistent and more efficient. The Sargan test does not reject instrument validity.

How to cite this tool

Using these results in a thesis, journal article, report or class assignment? Please cite this free tool so others can find it. It keeps the site free.

APA 7

Xavier, B. (2026). Instrumental Variables (2SLS) Regression [Web application]. FreeStatisticalTools.com. https://freestatisticaltools.com/instrumental-variables-2sls-regression/

BibTeX

@software{xavier_iv2slsregression_2026,
  author = {Xavier, Bibin},
  title = {Instrumental Variables (2SLS) Regression},
  publisher = {FreeStatisticalTools.com},
  year = {2026},
  url = {https://freestatisticaltools.com/instrumental-variables-2sls-regression/},
  note = {Web application}
}

Suggested sentence for your methods section: “The analysis was carried out with the free Instrumental Variables (2SLS) Regression tool on FreeStatisticalTools.com (Xavier, 2026).”

What is instrumental variables (2SLS) regression?

Two-stage least squares corrects for endogenous regressors, those correlated with the error term, by using instruments that affect the outcome only through the endogenous regressor. The first stage predicts the endogenous regressor from the instruments; the second stage uses those predictions.

When to use instrumental variables (2SLS) regression

Use 2SLS when a regressor is correlated with the error term, because of omitted variables, simultaneity or measurement error, and you have instruments that affect the outcome only through that regressor.

Assumptions

  • Relevance: instruments are strongly correlated with the endogenous regressor (first-stage F ≥ 10).
  • Exogeneity: instruments are uncorrelated with the structural error (untestable when exactly identified).

How to use this tool

  1. Enter your data. Paste columns from Excel, Google Sheets or SPSS with variable names in the first row, or upload a CSV or Excel file. The example data shows the expected layout.
  2. Choose the variables. Select the dependent variable, endogenous regressors, exogenous controls and excluded instruments.
  3. Set the options. Fill in standard errors.
  4. Read the results. Results update automatically. Read the plain-English interpretation, then use Copy table to paste APA-style tables into Word and Copy for the results sentence.

How to report instrumental variables (2SLS) regression in APA style

Report 2SLS and OLS estimates side by side, first-stage F statistics, and the Wu-Hausman and Sargan tests.

Frequently asked questions

What makes a good instrument?

It must be relevant (strongly correlated with the endogenous regressor, first-stage F ≥ 10) and exogenous (uncorrelated with the error in the outcome equation).

What does the Wu-Hausman test show?

Whether OLS and 2SLS differ significantly. If it rejects, the regressor is endogenous and 2SLS is preferred; if not, OLS is consistent and more efficient.

What is the Sargan test?

A test of over-identifying restrictions, available when there are more instruments than endogenous regressors. A significant result suggests at least one instrument is invalid.

Related tools

Browse all categories