wh.test | R Documentation |
White's test for heteroskedastic errors.
wh.test(mod, data = list(), sig.level = 0.05, details = FALSE, hyp = TRUE)
mod |
estimated linear model object or formula. |
data |
if |
sig.level |
significance level. Default value: |
details |
logical value indicating whether specific details about the test should be returned. |
hyp |
logical value indicating whether the hypotheses should be returned. |
A 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. |
White, H. (1980): A Heteroskedasticity-Consistent Covariance Matrix Estimator and a Direct Test for Heteroskedasticity. Econometrica 48, 817-838.
bptest
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.