simonoff_tsai {skedastic} | R Documentation |
Simonoff-Tsai Tests for Heteroskedasticity in a Linear Regression Model
Description
This function implements the modified profile likelihood ratio test and score test of Simonoff and Tsai (1994) for testing for heteroskedasticity in a linear regression model.
Usage
simonoff_tsai(
mainlm,
auxdesign = NA,
method = c("mlr", "score"),
hetfun = c("mult", "add", "logmult"),
basetest = c("koenker", "cook_weisberg"),
bartlett = TRUE,
optmethod = "Nelder-Mead",
statonly = FALSE,
...
)
Arguments
mainlm |
Either an object of |
auxdesign |
A |
method |
A character specifying which of the tests proposed in
Simonoff and Tsai (1994) to implement. |
hetfun |
A character describing the form of |
basetest |
A character specifying the base test statistic which is
robustified using the added term described in Details. |
bartlett |
A logical specifying whether a Bartlett correction should be
made, as per Ferrari et al. (2004), to improve the
fit of the test statistic to the asymptotic null distribution. This
argument is only applicable where |
optmethod |
A character specifying the optimisation method to use with
|
statonly |
A logical. If |
... |
Optional arguments to pass to |
Details
The Simonoff-Tsai Likelihood Ratio Test involves a modification of
the profile likelihood function so that the nuisance parameter will be
orthogonal to the parameter of interest. The maximum likelihood estimate
of (called
in
Simonoff and Tsai (1994)) is computed from the modified
profile log-likelihood function using the Nelder-Mead algorithm in
optim
. Under the null hypothesis of
homoskedasticity, the distribution of the test statistic is
asymptotically chi-squared with degrees of freedom. The test is
right-tailed.
The Simonoff-Tsai Score Test entails adding a term to either the score
statistic of Cook and Weisberg (1983) (a test implemented
in cook_weisberg
) or to that of
Koenker (1981) (a test implemented in
breusch_pagan
with argument koenker
set to
TRUE
), in order to improve the robustness of these respective
tests in the presence of non-normality. This test likewise has a test
statistic that is asymptotically -distributed and the test
is likewise right-tailed.
The assumption of underlying both tests is that
, where
is
an
diagonal matrix with
th diagonal element
. Here,
is the
th row of an
nonstochastic auxiliary design matrix
. Note:
as defined here does not have a column of ones, but is
concatenated to a column of ones when used in an auxiliary regression.
is a
-vector of unknown parameters, and
is a real-valued, twice-differentiable function having the
property that there exists some
for which
for all
. Thus, the null
hypothesis of homoskedasticity may be expressed as
.
In the score test, the added term in the test statistic is of the form
,
where is the
th element of the Jacobian matrix
evaluated at
:
,
and , where
is the
-vector whose
th element is
,
, and
.
Value
An object of class
"htest"
. If object is
not assigned, its attributes are displayed in the console as a
tibble
using tidy
.
References
Cook RD, Weisberg S (1983).
“Diagnostics for Heteroscedasticity in Regression.”
Biometrika, 70(1), 1–10.
Ferrari SL, Cysneiros AH, Cribari-Neto F (2004).
“An Improved Test for Heteroskedasticity Using Adjusted Modified Profile Likelihood Inference.”
Journal of Statistical Planning and Inference, 124, 423–437.
Griffiths WE, Surekha K (1986).
“A Monte Carlo Evaluation of the Power of Some Tests for Heteroscedasticity.”
Journal of Econometrics, 31(1), 219–231.
Koenker R (1981).
“A Note on Studentizing a Test for Heteroscedasticity.”
Journal of Econometrics, 17, 107–112.
Simonoff JS, Tsai C (1994).
“Use of Modified Profile Likelihood for Improved Tests of Constancy of Variance in Regression.”
Journal of the Royal Statistical Society. Series C (Applied Statistics), 43(2), 357–370.
Examples
mtcars_lm <- lm(mpg ~ wt + qsec + am, data = mtcars)
simonoff_tsai(mtcars_lm, method = "score")
simonoff_tsai(mtcars_lm, method = "score", basetest = "cook_weisberg")
simonoff_tsai(mtcars_lm, method = "mlr")
simonoff_tsai(mtcars_lm, method = "mlr", bartlett = FALSE)
## Not run: simonoff_tsai(mtcars_lm, auxdesign = data.frame(mtcars$wt, mtcars$qsec),
method = "mlr", hetfun = "logmult")
## End(Not run)