Hi, this is more related to understanding some statistics while using R; I've see such output in a paper: out <- glm(response~Var1+Var2+Var3..,family=binomial,data=mydata) summary(out) stepAIC(out) anova(out, test='Chisq') I understand that stepAIC is used to select the model with the lowest AIC (the best model) but can someone explain what is the purpose of doing the anova: anova(out, test='Chisq')? What extra information does it bring? Thanks -- View this message in context: http://r.789695.n4.nabble.com/anova-of-glm-output-tp2528336p2528336.html Sent from the R help mailing list archive at Nabble.com.
francogrex wrote:> > out <- glm(response~Var1+Var2+Var3..,family=binomial,data=mydata) > summary(out) > stepAIC(out) > anova(out, test='Chisq') > I understand that stepAIC is used to select the model with the lowest AIC > (the best model) but can someone explain what is the purpose of doing the > anova: anova(out, test='Chisq')? What extra information does it bring? > Thanks >"out" is of class glm (and lm, if that matters). So we have anova working on a glm class, which is documented in anova.glm. You should be aware that this anova depends on the order of you Varx, so be cautious. Dieter -- View this message in context: http://r.789695.n4.nabble.com/anova-of-glm-output-tp2528336p2528354.html Sent from the R help mailing list archive at Nabble.com.
The ANOVA adds the factors only in the order given in the model formula from left to right. You may try drop1(out, test="Chisq") -- View this message in context: http://r.789695.n4.nabble.com/anova-of-glm-output-tp2528336p2530620.html Sent from the R help mailing list archive at Nabble.com.