Learn R Programming

desk (version 1.1.2)

wh.test: White Heteroskedasticity Test

Description

White's test for heteroskedastic errors.

Usage

wh.test(mod, data = list(), sig.level = 0.05, details = FALSE, hyp = TRUE)

Value

A 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.

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

White, H. (1980): A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity. Econometrica 48, 817-838.

See Also

bptest.

Examples

Run this code
## White test for a model with two regressors
X <- wh.test(wage ~ educ + age, data = data.wage)

## Show the auxiliary regression results
X$hreg

## Prettier way
print(X, details = TRUE)

## Plot the test result
plot(X)

Run the code above in your browser using DataLab