ols_test_breusch_pagan: Breusch pagan test

Description Usage Arguments Details Value Deprecated Function References See Also Examples

Description

Test for constant variance. It assumes that the error terms are normally distributed.

Usage

1
2
3
ols_test_breusch_pagan(model, fitted.values = TRUE, rhs = FALSE,
  multiple = FALSE, p.adj = c("none", "bonferroni", "sidak", "holm"),
  vars = NA)

Arguments

model

An object of class lm.

fitted.values

Logical; if TRUE, use fitted values of regression model.

rhs

Logical; if TRUE, specifies that tests for heteroskedasticity be performed for the right-hand-side (explanatory) variables of the fitted regression model.

multiple

Logical; if TRUE, specifies that multiple testing be performed.

p.adj

Adjustment for p value, the following options are available: bonferroni, holm, sidak and none.

vars

Variables to be used for heteroskedasticity test.

Details

Breusch Pagan Test was introduced by Trevor Breusch and Adrian Pagan in 1979. It is used to test for heteroskedasticity in a linear regression model. It test whether variance of errors from a regression is dependent on the values of a independent variable.

Computation

Value

ols_test_breusch_pagan returns an object of class "ols_test_breusch_pagan". An object of class "ols_test_breusch_pagan" is a list containing the following components:

bp

breusch pagan statistic

p

p-value of bp

fv

fitted values of the regression model

rhs

names of explanatory variables of fitted regression model

multiple

logical value indicating if multiple tests should be performed

padj

adjusted p values

vars

variables to be used for heteroskedasticity test

resp

response variable

preds

predictors

Deprecated Function

ols_bp_test() has been deprecated. Instead use ols_test_breusch_pagan().

References

T.S. Breusch & A.R. Pagan (1979), A Simple Test for Heteroscedasticity and Random Coefficient Variation. Econometrica 47, 1287–1294

Cook, R. D.; Weisberg, S. (1983). "Diagnostics for Heteroskedasticity in Regression". Biometrika. 70 (1): 1–10.

See Also

Other heteroskedasticity tests: ols_test_bartlett, ols_test_f, ols_test_score

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# model
model <- lm(mpg ~ disp + hp + wt + drat, data = mtcars)

# use fitted values of the model
ols_test_breusch_pagan(model)

# use independent variables of the model
ols_test_breusch_pagan(model, rhs = TRUE)

# use independent variables of the model and perform multiple tests
ols_test_breusch_pagan(model, rhs = TRUE, multiple = TRUE)

# bonferroni p value adjustment
ols_test_breusch_pagan(model, rhs = TRUE, multiple = TRUE, p.adj = 'bonferroni')

# sidak p value adjustment
ols_test_breusch_pagan(model, rhs = TRUE, multiple = TRUE, p.adj = 'sidak')

# holm's p value adjustment
ols_test_breusch_pagan(model, rhs = TRUE, multiple = TRUE, p.adj = 'holm')

cmlopera/olsrr documentation built on May 26, 2019, 10:34 a.m.