verbyla | R Documentation |
This function implements the residual maximum likelihood test of \insertCiteVerbyla93;textualskedastic for testing for heteroskedasticity in a linear regression model.
verbyla(mainlm, auxdesign = NA, statonly = FALSE)
mainlm |
Either an object of |
auxdesign |
A |
statonly |
A logical. If |
Verbyla's Test entails fitting a generalised auxiliary regression
model in which the response variable is the vector of standardised
squared residuals e_i^2/\hat{\omega}
from the original OLS model
and the design matrix is some function of Z
, an n \times q
matrix consisting of q
exogenous variables, appended to a column of
ones. The test statistic is half the residual sum of squares from this
generalised auxiliary regression. Under the null hypothesis of
homoskedasticity, the distribution of the test statistic is
asymptotically chi-squared with q
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
.
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
verbyla(mtcars_lm)
verbyla(mtcars_lm, auxdesign = "fitted.values")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.