comparing mixed binomial model against the same model without random effect
If I am correct, you can compare a model with random effect with the same model without the random effect by using the nlme function, like this:
no.random.model <- gls(Richness ~ NAP * fExp,
method = "REML", data = RIKZ)
random.model <- lme(Richness ~NAP * fExp, data = RIKZ,
random = ~1 | fBeach, method = "REML")
But, nlme is valid only for the gaussian family, isn't it? In my case I have a mixed model with binomial family, like this:
random.model <- lme(sex ~hwp+hcp, data = mydata,
random = ~1 | colony, method = "REML")
where "sex" is a binary variable, "hwp" and "hcp" are continuous variable and "colony" is a factor with two levels.
I want to compare this model with another one without the random effect, I have tried with the lme4 but after this I cannot figure out how to build this same model without the random effect in order to make it comparable to the random effect model.
Re: comparing mixed binomial model against the same model without random effect
Any answer to this?
I really need to compare a mixed model with binomial error against the same model without the random effect. I would use anova() but I don't know how to specify both models in order to make them comparable.
Given that your response variable is binary and, consequently, you should
use generalized models, just occurs to me a comparison between a Generalized
Linear Model (the model without the random effect) and a Generalized Linear
Mixed Model (the model with the random effect).
My only doubt here is if one can directly compare both models, built under
different algorithms and from different packages.
Furthermore, I have no idea if the function 'anova' is able to compare
models produced by the 'glmer' function. One possibility is to compare them
based on Akaike Information Criteria (AIC) or any one of its corrected
I hope it helps you.
PhD student - Laboratory of Arthropod Behavior and Evolution
Universidade de São Paulo
a/c Glauco Machado
Departamento de Ecologia - IBUSP
Rua do Matão - Travessa 14 no 321 Cidade Universitária, São Paulo - SP,
Phone number: 55 11 3091-7488
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.