Hello dear R help members.

I am trying to understand the anova.rq, and I am finding something which I
can not explain (is it a bug?!):

The example is for when we have 3 nested models.  I run the anova once on
the two models, and again on the three models.  I expect that the p.value
for the comparison of model 1 and model 2 would remain the same, whether or
not I add a third model to be compared with.
However, the P values change, and I do not understand why.

Here is an example code (following with it's input):

data(barro)
fit0 <- rq(y.net ~  lgdp2 + fse2 , data = barro)
fit1 <- rq(y.net ~  lgdp2 + fse2 + gedy2 , data = barro)
fit2 <- rq(y.net ~  lgdp2 + fse2 + gedy2 + Iy2 , data = barro)
anova(fit0,fit1,fit2, R = 1000)
anova(fit0,fit1, R = 1000)


Output:

> data(barro)
> fit0 <- rq(y.net ~  lgdp2 + fse2 , data = barro)
> fit1 <- rq(y.net ~  lgdp2 + fse2 + gedy2 , data = barro)
> fit2 <- rq(y.net ~  lgdp2 + fse2 + gedy2 + Iy2 , data = barro)
> anova(fit0,fit1,fit2, R = 1000)
Quantile Regression Analysis of Deviance Table

Model 1: y.net ~ lgdp2 + fse2 + gedy2 + Iy2
Model 2: y.net ~ lgdp2 + fse2 + gedy2
Model 3: y.net ~ lgdp2 + fse2
  Df Resid Df F value    Pr(>F)
1  1      156  29.494 2.110e-07 ***
2  2      156  18.194 7.901e-08 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> anova(fit0,fit1, R = 1000)
Quantile Regression Analysis of Deviance Table

Model 1: y.net ~ lgdp2 + fse2 + gedy2
Model 2: y.net ~ lgdp2 + fse2
  Df Resid Df F value  Pr(>F)
1  1      157  3.9532 0.04852 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Hebrew_Israel.1255  LC_CTYPE=Hebrew_Israel.1255
[3] LC_MONETARY=Hebrew_Israel.1255 LC_NUMERIC=C
[5] LC_TIME=Hebrew_Israel.1255

attached base packages:
[1] splines   stats     graphics  grDevices utils     datasets  methods
base

other attached packages:
 [1] rms_3.3-1                    Hmisc_3.8-3
 survival_2.36-9
 [4] colorspace_1.1-0             quantreg_4.71                SparseM_0.89

 [7] PerformanceAnalytics_1.0.3.2 xts_0.8-2                    zoo_1.7-4

[10] reporttools_1.0.6            xtable_1.5-6

loaded via a namespace (and not attached):
[1] cluster_1.14.0  grid_2.13.1     lattice_0.19-33 tools_2.13.1






----------------Contact
Details:-------------------------------------------------------
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to