li_yao {skedastic} | R Documentation |
Li-Yao ALRT and CVT Tests for Heteroskedasticity in a Linear Regression Model
Description
This function implements the two methods of Li and Yao (2019) for testing for heteroskedasticity in a linear regression model.
Usage
li_yao(mainlm, method = c("cvt", "alrt"), baipanyin = TRUE, statonly = FALSE)
Arguments
mainlm |
Either an object of |
method |
A character indicating which of the two tests derived in
Li and Yao (2019) should be implemented. Possible
values are |
baipanyin |
A logical. Should the central limit theorem of
Bai et al. (2016) be used to determine the
|
statonly |
A logical. If |
Details
These two tests are straightforward to implement; in both cases the test statistic is a function only of the residuals of the linear regression model. Furthermore, in both cases the test statistic is asymptotically normally distributed under the null hypothesis of homoskedasticity. Both tests are right-tailed. These tests are designed to be especially powerful in high-dimensional regressions, i.e. when the number of explanatory variables is large.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Bai Z, Pan G, Yin Y (2016).
“Homoscedasticity Tests for Both Low and High-Dimensional Fixed Design Regressions.”
1603.03830, 1603.03830.
Li Z, Yao J (2019).
“Testing for Heteroscedasticity in High-Dimensional Regressions.”
Econometrics and Statistics, 9, 122–139.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
li_yao(mtcars_lm, method = "alrt")
li_yao(mtcars_lm, method = "cvt")
li_yao(mtcars_lm, method = "cvt", baipanyin = FALSE)
# Same as first example
li_yao(list("e" = mtcars_lm$residuals), method = "alrt")