I am trying to analyze data from an experiment in which I measured the learning of a colour preference in birds under two treatments. 40 Individuals were organized into 8 groups, and 4 groups were assigned to each treatment (i.e. individuals experienced only one treatment). I ran 70 trials which gave me 14 repeated observations (trials) on each individual (individuals were not measured in every trial but were focals once in every 5 trials).
I’m using glmer with a binomial distribution, where the response variable is the proportion of visits to feeders of the correct colour. I include Treatment and z-corrected trial number as fixed effects and group and individual as random effects, i.e.: GLMMHA12z <- glmer(cbind(Nb.correct.vis, Nb.vis.total) ~ Treat + TrialZ + (1|Group) + (1|Ind), data = d, family = binomial)
which would suggest over dispersion, but when we look for over dispersion there seems to be under dispersion:
chisq ratio rdf p
155.2787661 0.2870217 541.0000000 1.0000000
So, my questions are: 1) Could the fact than we have under dispersion when we might have expected over dispersion be due to the weight given to the observations? Many of the 0 and 1 proportions are cases where the bird only made 1 visit during the trial(82% when proportion = 0 and 72% when proportion = 1), so they should receive a lower weight in the model (if I understand correctly).
2) How should I deal with the under dispersion? I have tried to add an observation level random effect, but it doesn’t change anything:
d$obs<-as.factor(1:dim(d)1) GLMMHA12zObs <- glmer(cbind(Nb.correct.vis, Nb.vis.total) ~ Treat + TrialZ + (1|Group) + (1|Ind)+(1|obs), data = d, family = binomial)
overdisp_fun(GLMMHA12zObs) chisq ratio rdf p 155.2787657 0.2875533 540.0000000 1.0000000
GLMMHA12z: cbind(Nb.correct.vis, Nb.vis.total) ~ Treat + TrialZ + (1 | Group) + (1 | Ind)
GLMMHA12zObs: cbind(Nb.correct.vis, Nb.vis.total) ~ Treat + TrialZ + (1 | Group) + (1 | Ind) + (1 | obs)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
GLMMHA12z 5 985.03 1006.5 -487.51 975.03
GLMMHA12zObs 6 987.03 1012.9 -487.51 975.03 0 1 1