white | R Documentation |
This function implements the popular method of \insertCiteWhite80;textualskedastic for testing for heteroskedasticity in a linear regression model.
white(mainlm, interactions = FALSE, statonly = FALSE)
mainlm |
Either an object of |
interactions |
A logical. Should two-way interactions between explanatory
variables be included in the auxiliary regression? Defaults to
|
statonly |
A logical. If |
White's Test entails fitting an auxiliary regression model in which the response variable is the vector of squared residuals from the original model and the design matrix includes the original explanatory variables, their squares, and (optionally) their two-way interactions. The test statistic is the number of observations multiplied by the coefficient of determination from the auxiliary regression model:
T = n r_{\mathrm{aux}}^2
White's Test is thus a special case of the method of
\insertCiteBreusch79;textualskedastic. Under the null hypothesis of
homoskedasticity, the distribution of the test statistic is
asymptotically chi-squared with parameter
degrees of freedom.
The test is right-tailed.
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
This function should not be confused with
tseries::white.test
, which does
not implement the method of
\insertCiteWhite80;textualskedastic for testing for
heteroskedasticity in a linear model.
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
white(mtcars_lm)
white(mtcars_lm, interactions = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.