📘 MORISTAT: Advanced Econometrics

Chapter 2: Instrumental Variables (IV/2SLS)

Version 1.0  ·  July 2026  ·  naglal@linux-mauritius.com
2.1 The Endogeneity Problem

What Is Endogeneity?

Endogeneity occurs when an explanatory variable is correlated with the error term:

Cov(Xⱼ, ε) ≠ 0

When this happens, OLS estimates are:

Why Does Endogeneity Arise?

1. Omitted Variables

A relevant variable is excluded from the model, and it is correlated with both Y and an included X.

Example:

Wage = β₀ + β₁·Education + β₂·Ability + ε

If Ability is omitted and correlated with Education, then Cov(Education, ε) ≠ 0.

2. Measurement Error

Variables are measured with error, and the measurement error is correlated with the true value.

Example:

True model: Y = β₀ + β₁X* + ε
Observed: X = X* + u (measurement error)

If Cov(X, u) ≠ 0, then OLS is biased (attenuation bias).

3. Simultaneity (Reverse Causality)

Y causes X (rather than the other way around), or both are jointly determined.

Example:

Demand: Q = α₀ + α₁P + ε_d
Supply: Q = β₀ + β₁P + ε_s

Price and quantity are jointly determined by supply and demand.

4. Selection Bias

Sample selection is correlated with the outcome variable.

Example:

Wage = β₀ + β₁·Education + ε

But only working individuals are observed, and working is correlated with ability and education.

Consequences of Endogeneity:

EffectDescription
BiasEstimates are systematically wrong
InconsistencyEven with large samples, estimates don't converge to true values
Invalid Inferencet-tests and F-tests are unreliable
Misleading Policy ImplicationsWrong conclusions about causal effects
2.2 Instrumental Variables

The IV Solution

An Instrumental Variable (IV) is a variable Z that satisfies two key conditions:

Condition 1: Relevance (Z is correlated with X)
Cov(Z, X) ≠ 0

Z must be a good predictor of X. This is testable: the first-stage F-statistic should be > 10.

Condition 2: Exogeneity (Z is uncorrelated with ε)
Cov(Z, ε) = 0

Z affects Y only through X. This is not directly testable (unless we have overidentifying restrictions).

What Makes a Good Instrument?

CriterionDescriptionHow to Test
RelevanceZ is correlated with XFirst-stage F-statistic > 10
ExogeneityZ is uncorrelated with εOveridentification test (Sargan-Hansen)
ExclusionZ only affects Y through XEconomic theory + overidentification test

Examples of Instruments in Economics

Research QuestionEndogenous VariableInstrument
Returns to educationEducationQuarter of birth
Demand estimationPriceSupply shocks
Police and crimePoliceElection timing
Health insurance effectsInsurance coverageMedicare eligibility

The IV Estimator (Simple Case)

For the model: Yᵢ = β₀ + β₁Xᵢ + εᵢ

With instrument Zᵢ (correlated with X, uncorrelated with ε):

β̂_IV = Cov(Z, Y) / Cov(Z, X)

Why Does This Work?

Cov(Z, Y) = Cov(Z, β₀ + β₁X + ε) = β₁·Cov(Z, X) + Cov(Z, ε)

If Cov(Z, ε) = 0 (exogeneity), then:

β̂_IV = Cov(Z, Y) / Cov(Z, X) = β₁
2.3 Two-Stage Least Squares (2SLS)

The General 2SLS Setup

Consider the structural model:

Y₁ = β₀ + β₁Y₂ + β₂X₁ + β₃X₂ + ε

Where:

Stage 1: First-Stage Regression

Regress the endogenous variable Y₂ on all exogenous variables and instruments:

Y₂ = π₀ + π₁X₁ + π₂X₂ + π₃Z₁ + π₄Z₂ + v

Obtain the predicted values:

Ŷ₂ = π̂₀ + π̂₁X₁ + π̂₂X₂ + π̂₃Z₁ + π̂₄Z₂

Stage 2: Second-Stage Regression

Regress Y₁ on the predicted values from Stage 1:

Y₁ = β₀ + β₁Ŷ₂ + β₂X₁ + β₃X₂ + ε*

Matrix Form of 2SLS

β̂_2SLS = (X'P_Z X)⁻¹X'P_Z Y

Where:

The 2SLS Process in Words
STEP 1: Identify the endogenous variable(s) and instruments Y₂ is endogenous, Z₁ and Z₂ are instruments STEP 2: Run first-stage regression Y₂ = π₀ + π₁·X₁ + π₂·X₂ + π₃·Z₁ + π₄·Z₂ + v Get predicted values: Ŷ₂ STEP 3: Run second-stage regression Y₁ = β₀ + β₁·Ŷ₂ + β₂·X₁ + β₃·X₂ + ε Get 2SLS estimates STEP 4: Check diagnostics • First-stage F-statistic (relevance) • Hausman test (endogeneity) • Sargan-Hansen test (overidentification) • Weak instrument diagnostics
Important: Standard Errors

The second-stage OLS standard errors are incorrect because they use Ŷ₂ instead of Y₂. The correct standard errors must account for the first-stage estimation.

Correct standard errors should be computed using:

Var(β̂_2SLS) = σ̂² (X'P_Z X)⁻¹
2.4 Testing for Endogeneity

Hausman-Wu Test

Purpose: Test whether OLS and 2SLS estimates are significantly different.

Null Hypothesis: H₀: Cov(X, ε) = 0 (OLS is consistent)

Alternative: H₁: Cov(X, ε) ≠ 0 (OLS is inconsistent)

Procedure:

  1. Run first-stage regression: X = Zπ + v
  2. Obtain residuals: v̂ = X - Zπ̂
  3. Run augmented regression: Y = Xβ + v̂γ + ε
  4. Test H₀: γ = 0 using a t-test or F-test

Interpretation:

ResultDecisionInterpretation
p < 0.05Reject H₀Endogeneity detected → Use 2SLS
p ≥ 0.05Fail to reject H₀No endogeneity → OLS is consistent

Durbin-Wu-Hausman Test (Alternative)

  1. Estimate both OLS and 2SLS
  2. Compute: H = (β̂_2SLS - β̂_OLS)'[Var(β̂_2SLS) - Var(β̂_OLS)]⁻¹(β̂_2SLS - β̂_OLS)
  3. Under H₀, H ~ χ²(k)

When to Use OLS vs 2SLS

SituationRecommended
Hausman test p ≥ 0.10Use OLS (efficient)
Hausman test p < 0.05Use 2SLS (consistent)
0.05 ≤ p < 0.10Marginal evidence — use 2SLS
2.5 Testing Instruments

Relevance Test (First-Stage F-Statistic)

Purpose: Test whether instruments are correlated with the endogenous variable.

Rule of Thumb: First-stage F-statistic > 10 → Instruments are relevant.

First-Stage FAssessmentAction
F > 10Strong instrumentsProceed with 2SLS
5 < F < 10Weak instrumentsUse LIML or weak-IV robust methods
F < 5Very weak instrumentsUse alternative instruments
Why F > 10?

This rule comes from Staiger and Stock (1997) — F > 10 indicates that the finite-sample bias of 2SLS is less than 10% of the OLS bias.

Overidentification Test (Sargan-Hansen J-Test)

Purpose: Test whether the instruments are exogenous (valid).

Requirement: At least as many instruments as endogenous variables (overidentified model).

Procedure:

  1. Estimate 2SLS and obtain residuals: ε̂_2SLS
  2. Regress ε̂_2SLS on all instruments and exogenous variables
  3. Compute J = n × R² from this regression
  4. Under H₀, J ~ χ²(m) where m = (# instruments - # endogenous variables)

Interpretation:

ResultDecisionMeaning
p ≥ 0.10Fail to reject H₀Instruments are valid
p < 0.05Reject H₀Instruments are invalid
Sargan-Hansen Test Process
STEP 1: Estimate the structural model using 2SLS Y = Xβ + ε STEP 2: Obtain the residuals ê from the 2SLS estimation STEP 3: Regress ê on all instruments (Z) and exogenous variables ê = Zδ + η STEP 4: Compute J = n × R² STEP 5: Compare J to χ²(m) where m = (# instruments - # endogenous) Decision: Reject H₀ if J > critical value

Weak Instrument Diagnostics

2.6 Interpretation and Reporting

Reporting 2SLS Results

Coefficient Table with Both OLS and 2SLS

VariableOLS CoefOLS SE2SLS Coef2SLS SEDiff
Education0.0890.0120.1320.0180.043**
Experience0.0260.0080.0240.009-0.002
Intercept1.2340.4560.9870.512-0.247

First-Stage Results

First-Stage Regression (Dep Var: Education)

VariableCoefSEt-statp-value
Quarter 10.1450.0324.530.000
Quarter 20.0890.0283.180.001
Quarter 30.0340.0271.260.208

F-statistic: 18.56 Strong instruments

Diagnostic Tests Summary

Endogeneity Test (Hausman-Wu):
H = 6.78, df = 1, p = 0.009
→ Endogeneity detected (p < 0.05)

Overidentification Test (Sargan-Hansen):
J = 2.34, df = 2, p = 0.311
→ Instruments valid (p ≥ 0.10)

First-Stage F-statistic:
F = 18.56 Strong instruments

2.7 Applications and Examples
Example 1: Returns to Education

Research Question: What is the causal effect of education on earnings?

Problem: Education is endogenous because:

Solution: Use quarter of birth as an instrument (Angrist & Krueger, 1991)

Instruments: Quarter of birth (Q1, Q2, Q3) — affects education because of compulsory schooling laws but is randomly assigned and unrelated to ability.

Model:

Stage 1: Education = π₀ + π₁Q1 + π₂Q2 + π₃Q3 + π₄Experience + v Stage 2: Log(Wage) = β₀ + β₁·Education + β₂·Experience + ε
OLS2SLS
Education0.089**0.132**
Experience0.026**0.024**
N329,509329,509

Interpretation: An additional year of education increases earnings by 13.2% (2SLS) compared to 8.9% (OLS). The OLS estimate is biased downward due to ability bias.

Example 2: Demand Estimation

Research Question: What is the price elasticity of demand?

Problem: Price is endogenous because:

Solution: Use supply-side shocks as instruments

Instruments: Weather, input costs, capacity constraints

Model:

Stage 1: Price = π₀ + π₁·Weather + π₂·InputCost + π₃·Capacity + v Stage 2: Quantity = β₀ + β₁·Price + β₂·Income + ε
OLS2SLS
Price-0.45**-1.12**
Income0.23**0.21**

Interpretation: The OLS estimate (-0.45) is biased toward zero due to simultaneity. The 2SLS estimate (-1.12) suggests demand is elastic.

2.8 Implementation in Practice

Checklist for IV/2SLS Analysis

Common Mistakes to Avoid

MistakeWhy It's WrongWhat To Do Instead
Using weak instrumentsSevere bias in 2SLSUse first-stage F > 10
Invalid instrumentsBiased estimatesSargan-Hansen test
Failing to test endogeneityUsing 2SLS when OLS is efficientHausman-Wu test
Incorrect standard errorsInvalid inferenceUse robust SEs
Overinterpreting IV estimatesIV estimates identify LATEInterpret carefully
2.9 Interpreting IV Estimates

What IV Estimates Tell You

IV estimates identify the Local Average Treatment Effect (LATE) — the average treatment effect for those whose treatment status is affected by the instrument.

LATE = E[Y₁ - Y₀ | complier]

Where a complier is an individual whose treatment status is determined by the instrument.

Why LATE Matters

When LATE = ATE

ConditionImplication
Homogeneous treatment effectsLATE = ATE
Treatment monotonicityInstrument affects everyone in the same direction
Random instrumentLATE identifies a weighted average
Practical Implications
2.10 Advanced IV Topics

Limited Information Maximum Likelihood (LIML)

Why use LIML? When instruments are weak, 2SLS can be severely biased. LIML is less biased but has larger variance.

When to use LIML:

GMM Estimation

Generalized Method of Moments is more flexible than 2SLS:

Efficient GMM:

β̂_GMM = argmin_β [Z'(Y-Xβ)]' W [Z'(Y-Xβ)]

Where W is the optimal weighting matrix.

Dynamic Panel IV

For models with lagged dependent variables:

Y_it = αY_i,t-1 + βX_it + μ_i + ε_it

Arellano-Bond GMM: Uses lagged values as instruments.

Judging IV Validity

CriterionHow to AssessPassing Threshold
RelevanceFirst-stage F-statisticF > 10
ExogeneitySargan-Hansen J-testp ≥ 0.10
ExclusionEconomic theory + J-testJustifiable
MonotonicityFirst-stage signsConsistent
2.11 Practical Guidance

Finding Instruments

Good sources of instruments:

Tips for finding instruments:

  1. Understand the institutional context
  2. Look for exogenous variation in treatment
  3. Use economic theory to justify instruments
  4. Document plausibility of exogeneity

Sensitivity Analysis

Always test the robustness of your IV results:

  1. Overidentification test (Sargan-Hansen)
  2. Weak instrument test (First-stage F)
  3. Endogeneity test (Hausman-Wu)
  4. Specification tests (Different instruments)
  5. Placebo tests (Pretend instrument is invalid)

Reporting IV Results

Must include:

  1. First-stage regression results
  2. First-stage F-statistic
  3. Second-stage coefficient estimates
  4. Hausman-Wu test result
  5. Sargan-Hansen J-test result
  6. Comparison with OLS

Should include:

  1. Balance tests (covariates across instrument)
  2. Reduced-form results
  3. Sensitivity analysis
  4. Interpretive discussion of LATE
2.12 Key Concepts Glossary
2SLS — Two-Stage Least Squares — the standard IV estimator
Complier — Individual whose treatment status is affected by the instrument
Endogeneity — Correlation between regressor and error term
Exogeneity — Uncorrelated with the error term
Hausman Test — Test for endogeneity (OLS vs IV)
Instrument — Variable that is relevant and exogenous
LATE — Local Average Treatment Effect
LIML — Limited Information Maximum Likelihood
Overidentification — More instruments than endogenous variables
Relevance — Instrument is correlated with endogenous variable
Sargan-Hansen — Test for instrument exogeneity
Weak Instrument — Instrument with low first-stage F-statistic
2.13 Quick Reference Cards

IV/2SLS Formula Summary

Simple IV: β̂_IV = Cov(Z,Y) / Cov(Z,X) 2SLS: Stage 1: X = Zπ + v → Get X̂ Stage 2: Y = X̂β + ε Matrix Form: β̂_2SLS = (X'P_Z X)⁻¹X'P_Z Y Standard Errors: Var(β̂_2SLS) = σ²(X'P_Z X)⁻¹

Diagnostic Tests Summary

Relevance: F = (R²_first / m) / ((1-R²_first)/(n-k-m)) Rule: F > 10 (strong instruments) Endogeneity (Hausman-Wu): H = (β_IV - β_OLS)'[Var(β_IV)-Var(β_OLS)]⁻¹(β_IV - β_OLS) Distribution: χ²(k_endogenous) Rule: p < 0.05 → endogeneity Overidentification (Sargan-Hansen): J = n × R²_aux Distribution: χ²(m) Where m = (# instruments - # endogenous) Rule: p ≥ 0.10 → instruments valid
2.14 Chapter Summary

Key Takeaways

  1. Endogeneity is pervasive — Omitted variables, measurement error, and simultaneity are common in economics
  2. IV methods address endogeneity — Use instruments that are relevant and exogenous
  3. 2SLS is the workhorse — Two-stage procedure to get consistent estimates
  4. Always test instruments — Relevance (F > 10) and exogeneity (Sargan-Hansen)
  5. IV estimates are LATE — Interpret as the effect for compliers
  6. Diagnostics are essential — Hausman test, first-stage F, overidentification test
  7. Weak instruments are dangerous — Use alternative methods if F < 10
  8. Report OLS and IV — Compare to assess bias

Checklist Before Proceeding

2.15 What's Next?
📘 Chapter 3: Panel Data Models

In the next chapter, we will cover:

  1. Panel Data Structure — What is panel data? Why use it?
  2. Pooled OLS — Ignoring panel structure
  3. Fixed Effects (FE) — Entity-specific intercepts
  4. Random Effects (RE) — GLS estimation
  5. Hausman Test — Choosing between FE and RE
  6. Within vs Between Variation — Understanding the components
  7. Dynamic Panel Models — Arellano-Bond GMM
  8. Applications — Real-world examples