## S3 method for class 'rq':
anova(object, ...)
## S3 method for class 'rqlist':
anova(object, ..., test = "Wald", joint = TRUE,
score = "tau",R = 200, trim = NULL)
rq.test.rank(x0, x1, y, v = NULL, score = "wilcoxon", weights = NULL, tau=.5,
iid = TRUE, delta0 = rep(0,NCOL(x1)), omega = 1, trim = NULL, pvalue = "F")
rq.test.anowar(x0,x1,y,tau,R)
## S3 method for class 'anova.rq':
print(x, ...)
(trim, 1-trim)
, when
there are two values providIn the former case there are three options for
the argument `test', by default a Wald test is computed as in
Bassett and Koenker (1982). If test = 'anowar'
is specified
then the test is based on the procedure suggested in Chen, Ying, Zhang
and Zhao (2008); the test is based on the difference in the QR objective
functions at the restricted and unrestricted models with a reference
distribution computed by simulation. The p-value of this form of the
test is produced by fitting a density to the simulation values forming
the reference distribution using the logspline
function from
the test='rank'
is specified, then a rank
test statistic is computed as described in Gutenbrunner, Jureckova,
Koenker and Portnoy (1993). In the latter case one can also specify
a form for the score function of the rank test, by default the Wilcoxon
score is used, the other options are score=`sign' for median (sign) scores,
or score=`normal' for normal (van der Waerden) scores. A fourth option
is score=`tau' which is a generalization of median scores to an arbitrary
quantile, in this case the quantile is assumed to be the one associated
with the fitting of the specified objects. The computing of
the rank form of the test is carried out in the rq.test.rank
function, see ranks
for further details on the score function
options. The Wald form of the test is local in sense that the null hypothesis
asserts only that a subset of the covariates are ``insignificant'' at
the specified quantile of interest. The rank form of the test can also be
used to test the global hypothesis that a subset is ``insignificant''
over an entire range of quantiles. The use of the score function
score = "tau" restricts the rank test to the local hypothesis of
the Wald test.
In the latter case the hypothesis of interest is that the slope coefficients of the models are identical. The test statistic is a variant of the Wald test described in Koenker and Bassett (1982).
By default, both forms of the tests return an F-like statistic in the sense that the an asymptotically Chi-squared statistic is divided by its degrees of freedom and the reported p-value is computed for an F statistic based on the numerator degrees of freedom equal to the rank of the null hypothesis and the denominator degrees of freedom is taken to be the sample size minus the number of parameters of the maintained model.
[2] Koenker, R. W. and Bassett, G. W. (1982). Robust Tests for Heteroscedasticity based on Regression Quantiles, Econometrica, 50, 43--61. [3] Gutenbrunner, C., Jureckova, J., Koenker, R, and S. Portnoy (1993). Tests of Linear Hypotheses based on Regression Rank Scores, J. of Nonparametric Statistics, 2, 307--331.
[4] Chen, K. Z. Ying, H. Zhang, and L Zhao, (2008) Analysis of least absolute deviations, Biometrika, 95, 107-122.
[5] Koenker, R. W. (2005). Quantile Regression, Cambridge U. Press.
rq
,
and the functions for testing hypothesis on the entire quantile
regression process KhmaladzeTest
. For further details
on the rank tests see ranks
.data(barro)
fit0 <- rq(y.net ~ lgdp2 + fse2 + gedy2 , data = barro)
fit1 <- rq(y.net ~ lgdp2 + fse2 + gedy2 + Iy2 + gcony2, data = barro)
fit2 <- rq(y.net ~ lgdp2 + fse2 + gedy2 + Iy2 + gcony2, data = barro,tau=.75)
fit3 <- rq(y.net ~ lgdp2 + fse2 + gedy2 + Iy2 + gcony2, data = barro,tau=.25)
anova(fit1,fit0)
anova(fit1,fit2,fit3)
anova(fit1,fit2,fit3,joint=FALSE)
Run the code above in your browser using DataLab