li_yao | R Documentation |
This function implements the two methods of \insertCiteLi19;textualskedastic for testing for heteroskedasticity in a linear regression model.
li_yao(mainlm, method = c("cvt", "alrt"), baipanyin = TRUE, statonly = FALSE)
mainlm |
Either an object of |
method |
A character indicating which of the two tests derived in
\insertCiteLi19;textualskedastic should be implemented. Possible
values are |
baipanyin |
A logical. Should the central limit theorem of
\insertCiteBai16;textualskedastic be used to determine the
|
statonly |
A logical. If |
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.
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.