harvey {skedastic} | R Documentation |
Harvey Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the method of Harvey (1976) for testing for "multiplicative" heteroskedasticity in a linear regression model. Mittelhammer et al. (2000) gives the formulation of the test used here.
Usage
harvey(mainlm, auxdesign = NA, statonly = FALSE)
Arguments
mainlm |
Either an object of |
auxdesign |
A |
statonly |
A logical. If |
Details
Harvey's Test entails fitting an auxiliary regression model in
which the response variable is the log of the vector of squared
residuals 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
Harvey AC (1976).
“Estimating Regression Models with Multiplicative Heteroscedasticity.”
Econometrica, 44(3), 461–465.
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)
harvey(mtcars_lm)
harvey(mtcars_lm, auxdesign = "fitted.values")