white_test: White's heteroskedasticity test

Description Usage Arguments Value Examples

View source: R/white_test.R

Description

Compute the heteroskedasticity test proposed by White, H. (1980): "A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity". Econometrica. 48(4), 817–838.

Usage

1
white_test(model, full = TRUE, chisq = FALSE)

Arguments

model

an estimated model returned by lm or similar functions.

full

if TRUE add the regressors, their squares and their cross products to the auxiliary regression. If FALSE use only the regressors and their squares.

chisq

if TRUE the LM statistic of the auxiliary regression is returned. By default is FALSE and the F statistic is computed.

Value

An object of class htest with components:

statistic

the value of the test statistic.

p.value

the p-value of the test.

parameter

degrees of freedom.

method

a character string indicating what type of test was performed.

data.name

a character string describing the model.

Examples

1
2
3
4
data("hprice1")

mod <- lm(price ~ sqrft + lotsize + bdrms, data = hprice1)
white_test(mod)

jcpernias/ec1027 documentation built on Dec. 20, 2021, 10:03 p.m.