bp.test: Breusch-Pagan Test

View source: R/bp.test.R

bp.testR Documentation

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
)

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.

Value

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.

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

## 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)


desk documentation built on May 29, 2024, 6:05 a.m.

Related to bp.test in desk...