verbyla {skedastic} | R Documentation |
Verbyla's Test for Heteroskedasticity in a Linear Regression Model
Description
This function implements the residual maximum likelihood test of Verbyla (1993) for testing for heteroskedasticity in a linear regression model.
Usage
verbyla(mainlm, auxdesign = NA, statonly = FALSE)
Arguments
mainlm |
Either an object of |
auxdesign |
A |
statonly |
A logical. If |
Details
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.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Verbyla AP (1993). “Modelling Variance Heterogeneity: Residual Maximum Likelihood and Diagnostics.” Journal of the Royal Statistical Society. Series B (Statistical Methodology), 55(2), 493–508.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
verbyla(mtcars_lm)
verbyla(mtcars_lm, auxdesign = "fitted.values")