[R-sig-ME] Could the random effect at the level of each observation be a trap?

Billy billy.requena at gmail.com
Mon Dec 13 18:33:49 CET 2010

Hi Ben,

thanks for your reply.
In fact, I've tried the additive random effect of MaleID and resid,
but I got the same problem: quantitatively and qualitatively
differences. Models considering Male ID + resid showed smaller
deviances than models that only considered MaleID AND among models
considering MaleID + resid, the best model was the one which consider
no effect of any explanatory variable, while among models considering
only MaleID as random variable, the best model was the one considering
effect of the interaction between 2 explanatory variables.
I still have doubts about the usage of this "resid" variable, mainly
because the interpretation of the results is completely different. Is
the decrease of the whole deviance enough justification to use that
and interpret only the results obtained among models considering
MaleID + resid?

Thanks again for you all,


On Sat, Dec 11, 2010 at 12:27 PM, Ben Bolker <bbolker at gmail.com> wrote:
> On 10-12-10 09:39 PM, Billy wrote:
>> Hi all!
>> I'm a relatively newbie ecologist student getting adventures at the
>> mixed models world and facing some trouble to interpret random
>> effects. I hope someone could help me.
>> Quickly, I'm constructing different models using glmer() to discover
>> which factors could influence females' reproductive decisions. I have
>> sampled several males and classified them as successful or
>> unsuccessful.  Therefore, I'm modelling logistic regressions with more
>> than one fixed variable and random variables.
>> I have sampled individuals monthly and, sometimes, the same individual
>> (MaleID) was sampled more than once, in different status. Then, I used
>> "MaleID" as a random variable.
>> Well, I built a bunch of models considering only MaleID as the random
>> variable as:
>> m1 <- glmer(y ~ 1 + (1|MaleID), family=binomial)
>> m2 <- glmer(y ~ x + (1|MaleID), family=binomial)
>> m3 <- glmer(y ~ z + (1|MaleID), family=binomial)
>> Moreover, in several posts here I've read about count data show high
>> overdispersion, even using family=binomial for the error. One
>> recurrent solution suggested is create a vector to each observation
>> as:
>> resid <- as.factor(1:dim(data)[1])
>> Then, I built models considering this random variable too, trying to
>> understand that, as following
>> m4 <- glmer(y ~ 1 + (1|resid), family=binomial)
>> m5 <- glmer(y ~ x + (1|resid), family=binomial)
>> m6 <- glmer(y ~ w + (1|resid), family=binomial)
>> and
>> m7 <- glmer(y ~ 1 + (1|MaleID:resid ), family=binomial)
>> m8 <- glmer(y ~ x + (1|MaleID:resid ), family=binomial)
>> m9 <- glmer(y ~ z + (1|MaleID:resid ), family=binomial)
>> Using a model selection approach and looking for the deviance and the
>> AIC values, I observed that the correspondent models from the second
>> block (m4, m5 and m6 in the example above) and the third block (m7, m8
>> and m9) showed the same values. Is that due to the "resid" random
>> effect?
>   I think you want
>  ~ [fixed predictor(s)] + (1|MaleID)+(1|resid)
> ?
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

Gustavo Requena
PhD student - Laboratory of Arthropod Behavior and Evolution
Universidade de São Paulo
Correspondence adress:
a/c Glauco Machado
Departamento de Ecologia - IBUSP
Rua do Matão - Travessa 14 no 321 Cidade Universitária, São Paulo - SP, Brasil
CEP 05508-900
Phone number: 55 11 3091-7488


More information about the R-sig-mixed-models mailing list