SPSS command: SPSS 2SLS

Two-stage least squares (instrumental variables)

Two-stage least squares estimates a regression when an explanatory variable is endogenous — correlated with the error because of omitted factors, simultaneity or measurement error — by replacing it with its prediction from instruments that move it but do not affect the outcome directly.

Free · No account · Files stay on your device · Updated 18 October 2026

What it tells you

Crosstabs runs the SPSS 2SLS procedure on your device and reports a model description, fit statistics, ANOVA and coefficients based on the structural residuals.

  • A consistent estimate of the effect of an endogenous predictor, such as price on demand, where ordinary least squares would be biased.
  • Which variables were treated as exogenous (listed as both predictor and instrument) and which were instrumented (Model Description).
  • Standard errors, t tests and the overall F test computed from the structural residuals y − Zb.

When to use it

Use it when

  • Supply-and-demand or other simultaneous systems where the predictor and outcome are determined together.
  • A key predictor is measured with error, or likely confounded, and you have a variable that shifts it but is unrelated to the outcome's error.
  • Natural experiments, such as distance, policy timing or random encouragement, used as instruments.

Use something else when

  • No credible instrument: 2SLS with an invalid instrument is often worse than OLS, and weak instruments give large, unstable estimates.
  • All predictors are plausibly exogenous: ordinary linear regression is more precise.
  • You need first-stage diagnostics, overidentification tests or robust standard errors: this panel reports the structural model only.

How to run it in Crosstabs

  1. 01

    Choose Two-stage least squares

    Open your data in Statistics mode and, in the Regression group, pick Two-stage least squares (2SLS).

  2. 02

    Set the dependent variable

    Choose the Dependent variable and keep Include constant in equation ticked.

  3. 03

    List explanatory variables

    Tick every predictor of the structural equation under Explanatory variables, both endogenous and exogenous ones.

  4. 04

    List instrumental variables and run

    Under Instrumental variables tick the excluded instruments plus every exogenous explanatory variable; explanatory variables also listed here are treated as exogenous, the rest are instrumented. You need at least as many instruments as explanatory variables. Click Run.

Worked example

Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.

Try with example data

Data

80 synthetic markets. Price and demand share an unobserved shock, so price is correlated with the error; input cost moves price but not demand directly, and income enters both stages. True effects: −3 for price and 0.5 for income (fixed seed). Explanatory variables = price, income; Instrumental variables = cost, income.

Model Description
ItemType of Variable
demandDependent
incomePredictor & Instrumental
pricePredictor
costInstrumental
Model Summary
Multiple RR SquareAdjusted R SquareStd. Error of the Estimate
0.8070.6510.6423.276

R Square and the ANOVA use the structural residuals y − Zb, so the regression sum of squares can be negative when the instruments are weak.

Coefficients
ItemBStd. ErrorBetatSig.
(Constant)103.9734.46223.301<.001
price−3.1530.291−1.135−10.850<.001
income0.4740.0500.6459.562<.001

How to read it

Instrumenting price with cost gives a price coefficient of −3.153 (SE 0.291) and an income coefficient of 0.474 (SE 0.050). Running the same panel with price listed as its own instrument (ordinary least squares, which the worked example offers as a second run) gives −1.942 for price: the shared shock pushes the naive estimate toward zero, and the instrument removes most of that bias.

Output tables explained

Model Description
Each variable's role: Dependent, Predictor (instrumented), Instrumental, or Predictor & Instrumental (exogenous).
Model Summary
Multiple R, R Square, Adjusted R Square and Std. Error of the Estimate from the structural residuals; with weak instruments R² can be low or even negative.
ANOVA
Regression and residual sums of squares with the F test; the regression sum of squares is total minus structural residual and can be negative.
Coefficients
B, standard error, Beta, t and significance for the structural equation.

Assumptions and notes

  • Relevance: the instruments are correlated with the endogenous predictors after accounting for the exogenous ones.
  • Exclusion: the instruments affect the outcome only through the endogenous predictors and are uncorrelated with the structural error.
  • At least as many instruments as explanatory variables (order condition); the panel refuses under-identified models.
  • Homoscedastic, independent errors for the reported standard errors.

How the results are validated

2SLS is checked against linearmodels IV2SLS and R AER::ivreg on a fixture with one endogenous predictor, one exogenous predictor and two excluded instruments: coefficients agree within 1e-9, standard errors within 1e-8 (also against AER::ivreg), and R² and the residual sum of squares within 1e-9. A test also confirms the Predictor & Instrumental classification. Validation evidence

Questions

Why must exogenous predictors appear in both lists?

The first stage regresses each endogenous predictor on all instruments. Exogenous predictors are their own best instruments, so listing them under Instrumental variables keeps them unchanged and marks them Predictor & Instrumental.

What happens if every explanatory variable is also an instrument?

Nothing is instrumented and 2SLS reduces to ordinary least squares; the result says so. This is a quick way to see the OLS estimate for comparison.

Why is R² sometimes negative?

R² uses the structural residuals y − Zb with the actual endogenous values, not the fitted ones. If the instruments are weak, those residuals can exceed the total variation. R² is not a goodness-of-fit target in IV regression.

How do I know my instrument is strong enough?

Run the first stage yourself: a linear regression of the endogenous predictor on all instruments. An F statistic for the excluded instruments well above 10 is a common rule of thumb.

Run Two-Stage Least Squares on your own data

Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.