wilcox_keselman {skedastic} | R Documentation |
Wilcox and Keselman's Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the nonparametric test of Wilcox and Keselman (2006) for testing for heteroskedasticity in a simple linear regression model, and extends it to the multiple linear regression model.
Usage
wilcox_keselman(
mainlm,
gammapar = 0.2,
B = 500L,
p.adjust.method = "none",
seed = NA,
rqwarn = FALSE,
matchWRS = FALSE,
statonly = FALSE
)
Arguments
mainlm |
Either an object of |
gammapar |
A double value between 0 and 0.5 exclusive specifying the
quantile value |
B |
An integer specifying the number of nonparametric bootstrap samples
to use to estimate standard error(s) of the quantile difference(s).
Defaults to |
p.adjust.method |
A character specifying the family-wise error rate
method to use in adjusting |
seed |
An integer specifying a seed to pass to
|
rqwarn |
A logical specifying whether warnings generated by
|
matchWRS |
A logical specifying whether bootstrap samples should be
generated in the exact same manner as in the |
statonly |
A logical. If |
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Wilcox RR, Keselman HJ (2006). “Detecting Heteroscedasticity in a Simple Regression Model via Quantile Regression Slopes.” Journal of Statistical Computation and Simulation, 76(8), 705–712.
See Also
Rand R. Wilcox's package
WRS on Github; in particular
the functions qhomt
and qhomtv2
, which implement this
method for simple and multiple linear regression respectively.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
wilcox_keselman(mtcars_lm)