ECON 3209 · Week 12, Lecture 2 · Kerala Agricultural University
Autumn 2026
By the end of this lecture, you will be able to:
statsmodelsA good workflow is: 1. Estimate the model. 2. Plot residuals against fitted values or key regressors. 3. If the spread changes systematically, run a formal test.
Visual evidence helps you understand the type of heteroscedasticity before you rely on a test statistic.
The BP test asks whether squared residuals are systematically related to explanatory variables.
\[\hat{\varepsilon}^2_i = \alpha_0 + \alpha_1 Z_{1i} + \ldots + \alpha_p Z_{pi} + v_i\]
The White test is more flexible.
It allows variance to depend on: - regressors - squares of regressors - cross-products
This broader design can detect more general forms of heteroscedasticity, though at the cost of using more degrees of freedom.
Tests are evidence summaries, not mechanical truth machines. Always read them together with plots.
Once heteroscedasticity is detected, typical next steps are: - report robust standard errors - consider WLS if a reasonable variance model exists - revisit functional form or scale transformations such as logs
✅ Residual plots are the first practical check for heteroscedasticity.
✅ The Breusch-Pagan test regresses squared residuals on explanatory variables.
✅ The White test is more flexible because it allows squares and cross-products.
✅ Small p-values indicate evidence against homoskedasticity.
✅ The natural next step is robust inference or a weighted specification.
Lecture 3 — WLS & Robust SE in Python
We will cover: - HC3 robust standard errors - Weighted Least Squares - comparison of OLS, robust OLS, and WLS - when each remedy is appropriate
ECON 3209 — Kerala Agricultural University