[R] comparing mixed binomial model against the same model without random effect

lincoln miseno77 at hotmail.com
Sun Sep 25 10:19:36 CEST 2011

Thank you very much for answering,

I have just tried it and these are the results:

> random.model<-glmer(sex~hwp+hcp+(1|colony),family=binomial)
Mensajes de aviso perdidos
glm.fit: fitted probabilities numerically 0 or 1 occurred 

> no.random.model<-glm(sex~hwp+hcp,family=binomial)
Mensajes de aviso perdidos
glm.fit: fitted probabilities numerically 0 or 1 occurred 

> anova(no.random.model,random.model,test="Chisq")
Analysis of Deviance Table

Model: binomial, link: logit

Response: sex

Terms added sequentially (first to last)

     Df Deviance Resid. Df Resid. Dev P(>|Chi|)    
NULL                   425     581.51              
hwp   1   33.578       424     547.93 6.846e-09 ***
hcp   1  231.266       423     316.66 < 2.2e-16 ***
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

> AIC(no.random.model,random.model)
                df      AIC
no.random.model  3 322.6621
random.model     4 324.5072

I believe that the warning message arises from the fact that males have
almost all the values of "hcp" higher than zero and females tend to have
"zero" for that variable.
The anova procedure to compare models doesn't seem to work I would like, in
fact it seem that it is giving me the anova(model), i.e. the values of
intercept, slopes and their p values.
Even though, AIC() gives me two different values, I guess I could use them
to make this comparation.
I am worried about the algorithms beyond these two procedures (glm and
glmer) because if they calculate the likelihood in a different way they
would not be comparable neither the values of AIC.

Any other commentary/suggestion on this?


View this message in context: http://r.789695.n4.nabble.com/comparing-mixed-binomial-model-against-the-same-model-without-random-effect-tp3832891p3840963.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list