Português

Breusch-Pagan test

Models and regression · reference distribution: χ²(k)

When to use it

Check whether the variance of the residuals of a regression is constant (homoscedasticity).

Null hypothesis

The residuals are homoscedastic.

Assumptions

Test statistic

LM = n\, R^2_{\text{aux}}

How to report it

BP(2) = 8.9, p = .012

In R and Python

R
library(lmtest)
bptest(model)
Python
from statsmodels.stats.diagnostic import het_breuschpagan
het_breuschpagan(model.resid, model.model.exog)

In Python, stats is scipy.stats and np is numpy.

Variants and alternatives

Where it sits in the catalog

Models and regression. Tests run inside a fitted model: whether a coefficient matters, whether the model explains anything and whether the residuals meet the assumptions.

In the decision tree

  1. What do you want to do? Test a regression model
  2. What do you want to test? The residuals
  3. What problem do you suspect? Variance that changes with the fitted values

Open the decision tree