Learn R Programming

desk (version 1.1.2)

bp.test: Breusch-Pagan Test

Description

Breusch-Pagan test for heteroskedastic errors. The object of test results returned by this command can be plotted using the plot() function.

Usage

bp.test(
  mod,
  data = list(),
  varmod = NULL,
  koenker = TRUE,
  sig.level = 0.05,
  details = FALSE,
  hyp = TRUE
)

Value

List object including:

hypcharacter matrix of hypotheses (if hyp = TRUE).
resultsa data frame of basic test results.
hregmatrix of aux. regression results..
statsadditional statistic of aux. regression..
nulldisttype of the Null distribution with its parameters.

Arguments

mod

estimated linear model object or formula.

data

if mod is a formula then the corresponding data frame has to be specified.

varmod

formula object (starting with tilde ~) specifying the terms of regressors that explain sigma squared for each observation. If not specified the regular model mod is used.

koenker

logical value specifying whether Koenker's studentized version or the original Breusch-Pagan test should be performed.

sig.level

significance level. Default value: sig.level = 0.05.

details

logical value indicating whether specific details about the test should be returned.

hyp

logical value indicating whether the Hypotheses should be returned.

References

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.

See Also

wh.test, bptest.

Examples

Run this code
## 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)

Run the code above in your browser using DataLab