Class BreuschPagan
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.regression.linear.heteroskedasticity.Heteroskedasticity
-
- dev.nm.stat.test.regression.linear.heteroskedasticity.BreuschPagan
-
public class BreuschPagan extends Heteroskedasticity
The Breusch-Pagan test tests for conditional heteroskedasticity. The test statistics is computed by regressing squared residuals from the original regression against the original regressors (plus intercept). The test is a chi-squared test: the test statistic distribution is nχ2 with k degrees of freedom. If the Breush-Pagan test shows that there is conditional heteroscedasticity, it can be corrected by using the Hansen method, using robust standard errors, or re-thinking the regression equation. The R equivalent function isbptest
.- See Also:
- T. S. Breusch and A. R. Pagan, "A simple test for heteroscedasticity and random coefficient variation," Econometrica 47 (5): 1287-1294, 1979.
- R. Koenker, "A Note on Studentizing a Test for Heteroscedasticity," Journal of Econometrics 17, 107-112, 1981.
- Wikipedia: Breusch-Pagan test
-
-
Field Summary
-
Fields inherited from class dev.nm.stat.test.regression.linear.heteroskedasticity.Heteroskedasticity
N, residuals
-
-
Constructor Summary
Constructors Constructor Description BreuschPagan(LMResiduals residuals, boolean studentized)
Perform the Breusch-Pagan test to test for heteroskedasticity in a linear regression model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OLSRegression
getAuxiliaryRegression()
Define the transformation of residuals.double
statistics()
Get the test statistics.-
Methods inherited from class dev.nm.stat.test.regression.linear.heteroskedasticity.Heteroskedasticity
getAlternativeHypothesis, getAuxiliaryOLSRegression, getNullHypothesis, getX2, pValue
-
Methods inherited from class dev.nm.stat.test.HypothesisTest
isNullRejected, nGroups, nObs, oneSidedPvalue
-
-
-
-
Constructor Detail
-
BreuschPagan
public BreuschPagan(LMResiduals residuals, boolean studentized)
Perform the Breusch-Pagan test to test for heteroskedasticity in a linear regression model.- Parameters:
residuals
- theResiduals
object from an OLS regressionstudentized
-true
if to use Koenker's studentized version of the test statistic
-
-
Method Detail
-
getAuxiliaryRegression
public OLSRegression getAuxiliaryRegression()
Description copied from class:Heteroskedasticity
Define the transformation of residuals.- Specified by:
getAuxiliaryRegression
in classHeteroskedasticity
- Returns:
- an auxiliary regression
-
statistics
public double statistics()
Description copied from class:HypothesisTest
Get the test statistics.- Overrides:
statistics
in classHeteroskedasticity
- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
-