Heteroscedasticity occurs when residual variability changes systematically across predictor values instead of remaining constant. It can produce inefficient estimates, biased standard errors, and unreliable hypothesis tests or confidence intervals. section 4.2.4
Assess the assumption with a residuals plot and the Breusch–Pagan test. The test treats constant residual variance as the null hypothesis: a p-value below 5% indicates heteroscedasticity, while a larger p-value supports homoscedasticity. section 4.2.4
Testing residual variance in Python
Use `het_breuschpagan(lm.resid, lm.model.exog)` and inspect the returned p-value. A residuals plot places fitted values on the x-axis and residuals on the y-axis, helping reveal systematic changes in spread.



