honda {skedastic} | R Documentation |
Honda's Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the two-sided LM Test of Honda (1989) for testing for heteroskedasticity in a linear regression model.
Usage
honda(
mainlm,
deflator = NA,
alternative = c("two.sided", "greater", "less"),
twosidedmethod = c("doubled", "kulinskaya"),
qfmethod = "imhof",
statonly = FALSE
)
Arguments
mainlm |
Either an object of |
deflator |
Either a character specifying a column name from the
design matrix of |
alternative |
A character specifying the form of alternative
hypothesis. If it is suspected that the error variance is positively
associated with the deflator variable, |
twosidedmethod |
A character indicating the method to be used to compute
two-sided |
qfmethod |
A character, either |
statonly |
A logical. If |
Details
The test assumes that heteroskedasticity, if present, would be
either of the form \omega_i = \omega(1+\theta z_i)
or of the
form \omega_i = \omega e^{\theta z_i}
, where
where z_i
is a deflator (a nonstochastic variable
suspected of being related to the error variance), \omega
is
some unknown constant, and \theta
is an unknown parameter
representing the degree of heteroskedasticity. Since the test
statistic Q=\frac{e' A_0 e}{e'e}
is a ratio of quadratic forms
in the errors, the Imhof algorithm is used to compute p
-values.
Since the null distribution is in general asymmetrical, the two-sided
p
-value is computed using the conditional method of
Kulinskaya (2008), setting A=1
.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Honda Y (1989).
“On the Optimality of Some Tests of the Error Covariance Matrix in the Linear Regression Model.”
Journal of the Royal Statistical Society. Series B (Statistical Methodology), 51(1), 71–79.
Kulinskaya E (2008).
“On Two-Sided p-Values for Non-Symmetric Distributions.”
0810.2124, 0810.2124.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
# In this example, only the test statistic is returned, to save time
honda(mtcars_lm, deflator = "qsec", statonly = TRUE)