harvey | R Documentation |
This function implements the method of \insertCiteHarvey76;textualskedastic for testing for "multiplicative" heteroskedasticity in a linear regression model. \insertCiteMittelhammer00;textualskedastic gives the formulation of the test used here.
harvey(mainlm, auxdesign = NA, statonly = FALSE)
mainlm |
Either an object of |
auxdesign |
A |
statonly |
A logical. If |
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.
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
the description of the test in SHAZAM software (which produces identical results).
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
harvey(mtcars_lm)
harvey(mtcars_lm, auxdesign = "fitted.values")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.