[R] ANOVA in quantreg - faulty test for 'nesting'?
galen
galensher at gmail.com
Thu Apr 19 22:00:27 CEST 2012
I am trying to implement an ANOVA on a pair of quantile regression models in
R. The anova.rq() function performs a basic check to see whether the models
are nested, but I think this check is failing in my case. I think my models
are nested despite the anova.rqlist() function saying otherwise. Here is an
example where the GLM ANOVA regards the models as nested, but the quantile
regression ANOVA tells me the models aren't nested:
y = rnorm(100)
x1 = rnorm(100)
x2 = rnorm(100)
fmla1 = y~I(x1+x2)
fmla2 = y~x1+x2
f1 = glm(fmla1)
f2 = glm(fmla2)
anova(f1,f2) #This works
f1.qr = rq(fmla1)
f2.qr = rq(fmla2)
anova(f1.qr,f2.qr) #Error!
#Error in anova.rqlist(object, ...) : Models aren't nested
Are the models in fact not nested? If they are nested, is there an easy
workaround I could use? Many thanks in anticipation.
--
View this message in context: http://r.789695.n4.nabble.com/ANOVA-in-quantreg-faulty-test-for-nesting-tp4571994p4571994.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list