bp.test | R Documentation |
Breusch-Pagan test for heteroskedastic errors. The object of test results returned by this command can be plotted using the plot()
function.
bp.test(
mod,
data = list(),
varmod = NULL,
koenker = TRUE,
sig.level = 0.05,
details = FALSE,
hyp = TRUE
)
mod |
estimated linear model object or formula. |
data |
if |
varmod |
formula object (starting with tilde ~) specifying the terms of regressors that explain sigma squared for each observation. If not specified the regular model |
koenker |
logical value specifying whether Koenker's studentized version or the original Breusch-Pagan test should be performed. |
sig.level |
significance level. Default value: |
details |
logical value indicating whether specific details about the test should be returned. |
hyp |
logical value indicating whether the Hypotheses should be returned. |
List object including:
hyp | character matrix of hypotheses (if hyp = TRUE ). |
results | a data frame of basic test results. |
hreg | matrix of aux. regression results.. |
stats | additional statistic of aux. regression.. |
nulldist | type of the Null distribution with its parameters. |
Breusch, T.S. & Pagan, A.R. (1979): A Simple Test for Heteroscedasticity and Random Coefficient Variation. Econometrica 47, 1287-1294.
Koenker, R. (1981): A Note on Studentizing a Test for Heteroscedasticity. Journal of Econometrics 17, 107-112.
wh.test
, bptest
.
## BP test with Koenker's studentized residuals
X <- bp.test(wage ~ educ + age, data = data.wage, koenker = FALSE)
X
## A white test for the same model (auxiliary regression specified by \code{varmod})
bp.test(wage ~ educ + age, varmod = ~ (educ + age)^2 + I(educ^2) + I(age^2), data = data.wage)
## Similar test
wh.test(wage ~ educ + age, data = data.wage)
## Plot the test result
plot(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.