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:
- Biased: E(b) ≠ β (even in finite samples)
- Inconsistent: plim(b) ≠ β (does not converge to true value)
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:
| Effect | Description |
| Bias | Estimates are systematically wrong |
| Inconsistency | Even with large samples, estimates don't converge to true values |
| Invalid Inference | t-tests and F-tests are unreliable |
| Misleading Policy Implications | Wrong 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?
| Criterion | Description | How to Test |
| Relevance | Z is correlated with X | First-stage F-statistic > 10 |
| Exogeneity | Z is uncorrelated with ε | Overidentification test (Sargan-Hansen) |
| Exclusion | Z only affects Y through X | Economic theory + overidentification test |
Examples of Instruments in Economics
| Research Question | Endogenous Variable | Instrument |
| Returns to education | Education | Quarter of birth |
| Demand estimation | Price | Supply shocks |
| Police and crime | Police | Election timing |
| Health insurance effects | Insurance coverage | Medicare 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:
- Y₁ = dependent variable
- Y₂ = endogenous variable (correlated with ε)
- X₁, X₂ = exogenous variables (uncorrelated with ε)
- Z₁, Z₂ = instruments (correlated with Y₂, uncorrelated with ε)
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:
- P_Z = Z(Z'Z)⁻¹Z' (projection matrix onto Z)
- Z = instruments (including all exogenous variables)
- X = all regressors (endogenous + exogenous)
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:
- Run first-stage regression: X = Zπ + v
- Obtain residuals: v̂ = X - Zπ̂
- Run augmented regression: Y = Xβ + v̂γ + ε
- Test H₀: γ = 0 using a t-test or F-test
Interpretation:
| Result | Decision | Interpretation |
| p < 0.05 | Reject H₀ | Endogeneity detected → Use 2SLS |
| p ≥ 0.05 | Fail to reject H₀ | No endogeneity → OLS is consistent |
Durbin-Wu-Hausman Test (Alternative)
- Estimate both OLS and 2SLS
- Compute: H = (β̂_2SLS - β̂_OLS)'[Var(β̂_2SLS) - Var(β̂_OLS)]⁻¹(β̂_2SLS - β̂_OLS)
- Under H₀, H ~ χ²(k)
When to Use OLS vs 2SLS
| Situation | Recommended |
| Hausman test p ≥ 0.10 | Use OLS (efficient) |
| Hausman test p < 0.05 | Use 2SLS (consistent) |
| 0.05 ≤ p < 0.10 | Marginal 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 F | Assessment | Action |
| F > 10 | Strong instruments | Proceed with 2SLS |
| 5 < F < 10 | Weak instruments | Use LIML or weak-IV robust methods |
| F < 5 | Very weak instruments | Use 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:
- Estimate 2SLS and obtain residuals: ε̂_2SLS
- Regress ε̂_2SLS on all instruments and exogenous variables
- Compute J = n × R² from this regression
- Under H₀, J ~ χ²(m) where m = (# instruments - # endogenous variables)
Interpretation:
| Result | Decision | Meaning |
| p ≥ 0.10 | Fail to reject H₀ | Instruments are valid |
| p < 0.05 | Reject 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
- Angrist-Pischke F-Statistic: Test for weak instruments in the presence of multiple endogenous variables.
- Cragg-Donald F-Statistic: Test for weak instruments (similar to first-stage F).
- Stock-Yogo Critical Values: Provide critical values for weak instrument tests.
2.6 Interpretation and Reporting
Reporting 2SLS Results
Coefficient Table with Both OLS and 2SLS
| Variable | OLS Coef | OLS SE | 2SLS Coef | 2SLS SE | Diff |
| Education | 0.089 | 0.012 | 0.132 | 0.018 | 0.043** |
| Experience | 0.026 | 0.008 | 0.024 | 0.009 | -0.002 |
| Intercept | 1.234 | 0.456 | 0.987 | 0.512 | -0.247 |
First-Stage Results
First-Stage Regression (Dep Var: Education)
| Variable | Coef | SE | t-stat | p-value |
| Quarter 1 | 0.145 | 0.032 | 4.53 | 0.000 |
| Quarter 2 | 0.089 | 0.028 | 3.18 | 0.001 |
| Quarter 3 | 0.034 | 0.027 | 1.26 | 0.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:
- Ability is omitted
- Family background matters
- People choose education based on expected earnings
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 + ε
| OLS | 2SLS |
| Education | 0.089** | 0.132** |
| Experience | 0.026** | 0.024** |
| N | 329,509 | 329,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:
- Price and quantity are jointly determined
- Demand and supply shocks affect both
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 + ε
| OLS | 2SLS |
| Price | -0.45** | -1.12** |
| Income | 0.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
- Identify endogenous variables and their sources
- Find plausible instruments (economic theory + intuition)
- Test relevance (first-stage F-statistic > 10)
- Test exogeneity (Sargan-Hansen J-test)
- Test for endogeneity (Hausman-Wu test)
- If endogeneity detected and instruments valid → Use 2SLS
- If instruments weak → Use LIML or weak-IV robust methods
- Report both OLS and 2SLS results
- Interpret results cautiously
Common Mistakes to Avoid
| Mistake | Why It's Wrong | What To Do Instead |
| Using weak instruments | Severe bias in 2SLS | Use first-stage F > 10 |
| Invalid instruments | Biased estimates | Sargan-Hansen test |
| Failing to test endogeneity | Using 2SLS when OLS is efficient | Hausman-Wu test |
| Incorrect standard errors | Invalid inference | Use robust SEs |
| Overinterpreting IV estimates | IV estimates identify LATE | Interpret 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
- IV estimates do not estimate the average treatment effect for the whole population
- They estimate the effect for compliers only
- This may be different from the effect for always-takers or never-takers
When LATE = ATE
| Condition | Implication |
| Homogeneous treatment effects | LATE = ATE |
| Treatment monotonicity | Instrument affects everyone in the same direction |
| Random instrument | LATE identifies a weighted average |
Practical Implications
- External validity: IV estimates may not generalize to the whole population
- Policy relevance: LATE is relevant for policies that affect the marginal complier
- Interpretation: Clearly state that IV estimates are LATE
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:
- Weak instruments (first-stage F < 10)
- Many instruments (overfit concerns)
- Small samples
GMM Estimation
Generalized Method of Moments is more flexible than 2SLS:
- Allows for heteroskedasticity
- More efficient with many instruments
- Robust to weak instruments
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
| Criterion | How to Assess | Passing Threshold |
| Relevance | First-stage F-statistic | F > 10 |
| Exogeneity | Sargan-Hansen J-test | p ≥ 0.10 |
| Exclusion | Economic theory + J-test | Justifiable |
| Monotonicity | First-stage signs | Consistent |
2.11 Practical Guidance
Finding Instruments
Good sources of instruments:
- Random assignment (natural experiments)
- Policy reforms (exogenous variation)
- Geographic variation (border effects)
- Historical factors (path dependence)
- Technical changes (exogenous shocks)
Tips for finding instruments:
- Understand the institutional context
- Look for exogenous variation in treatment
- Use economic theory to justify instruments
- Document plausibility of exogeneity
Sensitivity Analysis
Always test the robustness of your IV results:
- Overidentification test (Sargan-Hansen)
- Weak instrument test (First-stage F)
- Endogeneity test (Hausman-Wu)
- Specification tests (Different instruments)
- Placebo tests (Pretend instrument is invalid)
Reporting IV Results
Must include:
- First-stage regression results
- First-stage F-statistic
- Second-stage coefficient estimates
- Hausman-Wu test result
- Sargan-Hansen J-test result
- Comparison with OLS
Should include:
- Balance tests (covariates across instrument)
- Reduced-form results
- Sensitivity analysis
- 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
- Endogeneity is pervasive — Omitted variables, measurement error, and simultaneity are common in economics
- IV methods address endogeneity — Use instruments that are relevant and exogenous
- 2SLS is the workhorse — Two-stage procedure to get consistent estimates
- Always test instruments — Relevance (F > 10) and exogeneity (Sargan-Hansen)
- IV estimates are LATE — Interpret as the effect for compliers
- Diagnostics are essential — Hausman test, first-stage F, overidentification test
- Weak instruments are dangerous — Use alternative methods if F < 10
- Report OLS and IV — Compare to assess bias
Checklist Before Proceeding
- Understand the sources of endogeneity
- Can identify good instruments
- Know how to perform 2SLS
- Can interpret IV results
- Know the diagnostic tests
- Understand LATE interpretation
- Ready for Panel Data (Chapter 3)
2.15 What's Next?
📘 Chapter 3: Panel Data Models
In the next chapter, we will cover:
- Panel Data Structure — What is panel data? Why use it?
- Pooled OLS — Ignoring panel structure
- Fixed Effects (FE) — Entity-specific intercepts
- Random Effects (RE) — GLS estimation
- Hausman Test — Choosing between FE and RE
- Within vs Between Variation — Understanding the components
- Dynamic Panel Models — Arellano-Bond GMM
- Applications — Real-world examples