glejser {skedastic} | R Documentation |
Glejser Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the method of Glejser (1969) for testing for "multiplicative" heteroskedasticity in a linear regression model. Mittelhammer et al. (2000) gives the formulation of the test used here.
Usage
glejser(
mainlm,
auxdesign = NA,
sigmaest = c("main", "auxiliary"),
statonly = FALSE
)
Arguments
mainlm |
Either an object of |
auxdesign |
A |
sigmaest |
A character indicating which model residuals to use in the
|
statonly |
A logical. If |
Details
Glejser's Test entails fitting an auxiliary regression model in
which the response variable is the absolute residual from the original
model and the design matrix Z
consists of one or more exogenous
variables that are suspected of being related to the error variance.
In the absence of prior information on a possible choice of Z
,
one would typically use the explanatory variables from the original model.
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.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Glejser H (1969).
“A New Test for Heteroskedasticity.”
Journal of the American Statistical Association, 64(325), 316–323.
Mittelhammer RC, Judge GG, Miller DJ (2000).
Econometric Foundations.
Cambridge University Press, Cambridge.
See Also
the description of the test in SHAZAM software (which produces identical results).
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
glejser(mtcars_lm)