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.

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

data("hprice1") mod <- lm(price ~ sqrft + lotsize + bdrms, data = hprice1) white_test(mod)
#> #> White's test for heteroskedasticity #> #> data: Auxiliary regression of squared residuals from: #> lm(price ~ sqrft + lotsize + bdrms, data = hprice1) #> on all covariates, their squares and cross-products. #> #> #> F = 5.387, df1 = 9, df2 = 78, p-value = 1.013e-05 #>