📚 Introductory Econometrics with MORISTAT

A Practical Guide to Empirical Analysis

Naguib Lallmahomed · naglal@linux-mauritius.com · 2026-06-14


Chapter 7: Heteroskedasticity, Serial Correlation, and Instrumental Variables

🎯 Learning Objectives

Upon completing this chapter, you will be able to:

7.1 Heteroskedasticity

7.1.1 What is Heteroskedasticity?

Heteroskedasticity occurs when the variance of the error term is not constant across observations:

Var(u|X₁, X₂, …, Xₖ) = σᵢ² (varies with i)

Instead of the homoskedastic assumption: Var(u|X) = σ² (constant).

Example: In cross‑sectional data, the variance of consumption expenditure often increases with income (rich people have more variability in spending).

7.1.2 Consequences

7.1.3 Detection

7.1.4 Remedies

7.2 Serial Correlation (Autocorrelation)

7.2.1 What is Serial Correlation?

Serial correlation occurs when errors are correlated across time (or across observations that have a natural order).

Corr(uᵢ, uⱼ) ≠ 0 for i ≠ j

Most common in time series data (e.g., GDP, stock prices, inflation).

7.2.2 Consequences

7.2.3 Detection

7.2.4 Remedies

7.3 Instrumental Variables (IV) / Two‑Stage Least Squares (2SLS)

7.3.1 The Problem of Endogeneity

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

Corr(Xⱼ, u) ≠ 0

Common causes:

7.3.2 The Instrumental Variables Solution

An instrument Z is a variable that:

The IV estimator is:

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

7.3.3 Two‑Stage Least Squares (2SLS)

  1. Stage 1: Regress X on all instruments and exogenous variables. Obtain fitted values X̂.
  2. Stage 2: Regress Y on X̂ and exogenous variables. The coefficient on X̂ is the 2SLS estimate.

Important: The number of instruments must be at least the number of endogenous variables.

If you have more instruments than endogenous variables, you can test for overidentifying restrictions (Sargan / Hansen J test).

7.4 MORISTAT Implementation

Currently, the MORISTAT web console does not include built‑in commands for:

However, you can manually compute some diagnostics using the residuals from REGRESS. For example, after a regression, you can examine residuals for patterns.

Manual diagnostic example:

MORISTAT> LOAD hetero_data.csv
MORISTAT> REGRESS Y ~ X
MORISTAT> DIAG                 (shows residuals, skewness, kurtosis)
MORISTAT> PREDICT              (gives fitted values and residuals)

You can then plot residuals vs fitted values using external software to check for heteroskedasticity.

7.5 Practice Exercises

Exercise 7.1: Detecting Heteroskedasticity

You estimate the model: Wage = β₀ + β₁ × Education + β₂ × Experience + u.

After estimating, you plot the residuals against Education and see a fan‑shaped pattern (variance increases with Education).

  1. What does this pattern suggest?
  2. What are the consequences for your regression results?
  3. What remedy would you suggest?

Solution:

  • Suggests heteroskedasticity.
  • Consequences: OLS still unbiased but inefficient; standard errors are biased (usually too small).
  • Remedy: Use robust standard errors or transform the dependent variable (e.g., log(Wage)).

Exercise 7.2: Serial Correlation in Time Series

You have quarterly data on GDP growth and estimate the model: GDP_growth = β₀ + β₁ × InterestRate + u.

The Durbin‑Watson statistic is 0.45.

  1. What does a DW statistic close to 0 indicate?
  2. What is the consequence for OLS?
  3. How could you fix this problem?

Solution:

  • DW close to 0 indicates strong positive autocorrelation (ρ̂ ≈ 1).
  • Consequence: OLS is inefficient, and standard errors are biased (often understated).
  • Fix: Use Newey‑West standard errors or estimate an AR(1) model (e.g., Cochrane‑Orcutt).

Exercise 7.3: Instrumental Variables

You want to estimate the effect of education on wages, but education is endogenous because ability is unobserved and correlated with education. You have a potential instrument: distance to the nearest college.

  1. Explain why distance to college might be a good instrument for education.
  2. What assumptions must hold for distance to be a valid instrument?
  3. If you have only one instrument for one endogenous variable, can you test the validity of the instrument?

Solution:

  • Distance to college is likely correlated with education (closer → more likely to attend college) – relevance.
  • It must be uncorrelated with the error term (i.e., not directly affecting wages except through education) – exogeneity.
  • With one instrument for one endogenous variable, the model is just‑identified; you cannot test the exogeneity assumption (overidentifying restrictions test requires more instruments than endogenous variables).

Exercise 7.4: 2SLS in Practice

You have data on education, wages, and two instruments: distance and parent_education. Describe the steps to estimate the effect of education on wages using 2SLS.

Solution:

  1. Stage 1: Regress Education on distance, parent_education, and any other exogenous variables. Obtain fitted values Education̂.
  2. Stage 2: Regress Wage on Education̂ (and other exogenous variables).
  3. The coefficient on Education̂ is the 2SLS estimate of the causal effect of education on wages.
  4. Since you have 2 instruments for 1 endogenous variable, you can test overidentifying restrictions (Sargan test) to check instrument validity.

7.6 Key Terms

Heteroskedasticity Homoskedasticity Breusch‑Pagan Test White Test Robust Standard Errors Weighted Least Squares (WLS) Serial Correlation Autocorrelation Durbin‑Watson Test Newey‑West Standard Errors Endogeneity Instrumental Variable (IV) Relevance Exogeneity Two‑Stage Least Squares (2SLS) Overidentifying Restrictions

7.7 Further Reading

🔄 Ready to connect with MORISTAT?