Breusch–Pagan test explained

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 (Cook–Weisberg test).[2] Derived from the Lagrange multiplier test principle, it tests whether the variance of the errors from a regression is dependent on the values of the independent variables. In that case, heteroskedasticity is present.

Formulation

Suppose that we estimate the regression model

y=\beta0+\beta1x+u,

and obtain from this fitted model a set of values for

\widehat{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

\widehat{u}2=\gamma0+\gamma1x+v.

This is the basis of the Breusch–Pagan test. It is a chi-squared test: the test statistic is distributed 2 with k degrees of freedom. If the test statistic has a 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, one could either use weighted least squares (if the source of heteroskedasticity is known) or use heteroscedasticity-consistent standard errors.

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

2
\sigma
i

=h(zi'\gamma)

for the variances of the observations where

zi=(1,z2i,\ldots,zpi)

explain the difference in the variances. The null hypothesis is equivalent to the

(p-1)

parameter restrictions:

\gamma2==\gammap=0.

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

LM=\left(

\partial\ell
\partial\theta

\right)T\left(-E\left[

\partial2\ell
\partial\theta\partial\theta'

\right]\right)-1\left(

\partial\ell
\partial\theta

\right).

This test can be implemented via the following three-step procedure:

yi=Xi\beta+\varepsiloni,i=1,...{},n

\hat{\varepsilon}i

, square them, and divide by the Maximum Likelihood estimate of the error variance from the Step 1 regression, to obtain what Breusch and Pagan call

gi

:

gi=

2
\hat{\varepsilon}
i

/\hat{\sigma}2,\hat{\sigma}2=

2}/n
\sum{\hat{\varepsilon}
i

gi=\gamma1+\gamma2z2i+ … +\gammapzpii.

where the z terms will typically but not necessarily be the same as the original covariates x.
LM=1
2

\left(TSS-RSS\right).

where TSS is the sum of squared deviations of the

gi

from their mean of 1, and RSS is the sum of squared residuals from the auxiliary regression.The test statistic is asymptotically distributed as
2
\chi
p-1
under the null hypothesis of homoskedasticity and normally distributed

\varepsiloni

, as proved by Breusch and Pagan in their 1979 paper.

Robust variant

A variant of this test, robust in the case of a non-Gaussian error term, was proposed by Roger Koenker.[3] In this variant, the dependent variable in the auxiliary regression is just the squared residual from the Step 1 regression,

2
\hat{\varepsilon}
i
, and the test statistic is

nR2

from the auxiliary regression. As Koenker notes (1981, page 111), while the revised statistic has correct asymptotic size its power "may be quite poor except under idealized Gaussian conditions."

Software

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

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

In SAS, Breusch–Pagan can be obtained using the Proc Model option.

In Python, there is a method het_breuschpagan in statsmodels.stats.diagnostic (the statsmodels package) for Breusch–Pagan test.[11]

In gretl, the command modtest --breusch-pagan can be applied following an OLS regression.

See also

Further reading

Notes and References

  1. Breusch . T. S. . Trevor Breusch . Pagan . A. R. . Adrian Pagan . A Simple Test for Heteroskedasticity and Random Coefficient Variation . . 1979 . 47 . 5 . 1287–1294 . 545960 . 1911963 . 10.2307/1911963.
  2. Cook . R. D. . R. Dennis Cook . S. . Weisberg . 1983 . Diagnostics for Heteroskedasticity in Regression . . 70 . 1 . 1–10 . 10.1093/biomet/70.1.1 . 11299/199411 . free .
  3. Koenker . Roger . Roger Koenker . A Note on Studentizing a Test for Heteroscedasticity . . 1981 . 17 . 107–112 . 10.1016/0304-4076(81)90062-2 .
  4. https://mran.microsoft.com/web/packages/car/car.pdf#page=86 MRAN: ncvTest
  5. https://www.rdocumentation.org/packages/lmtest/versions/0.9-36/topics/bptest R documentation about bptest
  6. Book: Christian . Kleiber . Achim . Zeileis . Applied Econometrics with R . New York . Springer . 2008 . 978-0-387-77316-2 . 101–102 .
  7. https://mran.microsoft.com/web/packages/plm/plm.pdf#page.71 MRAN: plmtest
  8. Web site: skedastic: Heteroskedasticity Diagnostics for Linear Regression Models.
  9. Web site: regress postestimation — Postestimation tools for regress . Stata Manual .
  10. Book: A. Colin . Cameron . Pravin K. . Trivedi . Microeconometrics Using Stata . Revised . 2010 . Stata Press . 97 . 9781597180481 . .
  11. Web site: statsmodels.stats.diagnostic.het_breuschpagan — statsmodels 0.8.0 documentation. www.statsmodels.org. 2017-11-16.