The Breusch–Pagan test checks whether regression-residual variance changes systematically with the independent variables. Constant variance supports reliable standard errors, hypothesis tests, and confidence intervals; changing variance indicates heteroscedasticity. section 4.2.4
The test proceeds by:
- Regressing the squared residuals from the original model on the independent variables in an auxiliary regression. section 4.2.4
- Testing the null hypothesis that residuals are homoscedastic. section 4.2.4
- Rejecting the null when the p-value is below 5%, indicating heteroscedasticity; larger p-values support the constant-variance assumption. section 4.2.4
Python with statsmodels
from statsmodels.stats.diagnostic import het_breuschpagan lm_BreuschPagan = het_breuschpagan(lm.resid, lm.model.exog) print(lm_BreuschPagan[1]) # 0.181071316321208 Because the p-value exceeds 0.05, this result does not indicate heteroscedasticity under the stated decision rule.
