# Breusch–Pagan test

In statistics, the Breusch–Pagan test, developed in 1979 by Trevor Breusch and Adrian Pagan,[1] is used to test for heteroskedasticity in a linear regression model. It was independently suggested with some extension by R. Dennis Cook and Sanford Weisberg in 1983.[2] It tests whether the estimated variance of the residuals from a regression are dependent on the values of the independent variables. In that case, heteroskedasticity is present.

Suppose that we estimate the regression model

${\displaystyle y=\beta _{0}+\beta _{1}x+u,\,}$

and obtain from this fitted model a set of values for ${\displaystyle {\hat {u}}}$, the residuals. Ordinary least squares constrains these so that their mean is 0 and so, given the assumption that their variance does not depend on the independent variables, an estimate of this variance can be obtained from the average of the squared values of the residuals. If the assumption is not held to be true, a simple model might be that the variance is linearly related to independent variables. Such a model can be examined by regressing the squared residuals on the independent variables, using an auxiliary regression equation of the form

${\displaystyle {\hat {u}}^{2}=\gamma _{0}+\gamma _{1}x+v.\,}$

This is the basis of the Breusch–Pagan test. If an F-test confirms that the independent variables are jointly significant then the null hypothesis of homoskedasticity can be rejected.

The Breusch–Pagan test tests for conditional heteroskedasticity.[citation needed] It is a chi-squared test:[clarification needed] the test statistic is nχ2 with k degrees of freedom. It tests the null hypothesis of homoskedasticity. If the Chi Squared value is significant with p-value below an appropriate threshold (e.g. p<0.05) then the null hypothesis of homoskedasticity is rejected and heteroskedasticity assumed. If the Breusch–Pagan test shows that there is conditional heteroskedasticity, the original regression can be corrected by using the Hansen method[citation needed], using robust standard errors, or re-thinking the regression equation by changing and/or transforming independent variables.

## Procedure

Under the classical assumptions, ordinary least squares is the best linear unbiased estimator (BLUE), i.e., it is unbiased and efficient. It remains unbiased under heteroskedasticity, but efficiency is lost. Before deciding upon an estimation method, one may conduct the Breusch–Pagan test to examine the presence of heteroskedasticity. The Breusch–Pagan test is based on models of the type ${\displaystyle \sigma _{i}^{2}=h(z_{i}'\gamma )}$ for the variances of the observations where ${\displaystyle z_{i}=(1,z_{2i},\dots ,z_{pi})}$ explain the difference in the variances. The null hypothesis is equivalent to the ${\displaystyle (p-1)\,}$ parameter restrictions:

${\displaystyle \gamma _{2}=\dots =\gamma _{p}=0.}$

The following Lagrange multiplier (LM) yields the test statistic for the Breusch–Pagan test:[citation needed]

${\displaystyle LM=\left({\frac {\partial l}{\partial \theta }}\right)'\left(-E\left[{\frac {\partial ^{2}l}{\partial \theta \partial \theta '}}\right]\right)^{-1}\left({\frac {\partial l}{\partial \theta }}\right).}$

This test is analogous to following the simple three-step procedure:[3]

• Step 1: Apply OLS in the model
${\displaystyle y=X\beta +\varepsilon .}$

and compute the regression residuals.

• Step 2: Perform the auxiliary regression
${\displaystyle e_{i}^{2}=\gamma _{1}+\gamma _{2}z_{2i}+\dots +\gamma _{p}z_{pi}+\eta _{i}.}$

Always, z could be partly replaced by independent variables x.

• Step 3: The test statistic is the result of the coefficient of determination of the auxiliary regression in Step 2 and sample size ${\displaystyle n\,}$ with:
${\displaystyle LM=nR^{2}\,.}$

The test statistic is asymptotically distributed as ${\displaystyle \chi _{p-1}^{2}}$ under the null hypothesis of homoskedasticity.[4]

## Software

In R, this test is performed by the function ncvTest available in the car package,[5] the function bptest available in the lmtest package,[6] or the function plmtest available in the plm package.[7]

In Stata, one specifies the full regression, and then enters the command estat hettest followed by all independent variables.[8]

In SAS, breusch pagan can be obtained using the Proc Model option.

In Python, there is a method het_breushpagan in statsmodels.stats.diagnostic (the statsmodels package) for breusch-pagan test.