Skip to content
Prev 181579 / 398502 Next

Hierarchical glm with binomial family

Johan Stenberg-2 wrote:
You probably need a GLMM (generalized linear mixed model), which is
a little bit of a can of worms.  If so, you will need the "glmer" function
inside the "lmer" package.

  I'm not entirely clear about your experimental design: I understand
that subpopulations are nested within populations, but it's not clear
whether covariates (distances to heterospecific plants) differ within
subpopulations or populations.

  If they don't differ with subpopulations, I would (strongly) recommend
aggregating the
values within subpopulations and analyzing proportions as a regression
analysis:
see Murtaugh, Paul A. ?SIMPLICITY AND COMPLEXITY IN ECOLOGICAL
 DATA ANALYSIS.? Ecology 88, no. 1 (2007): 56-62.

  If they do, then your design is

model<-glmer(Herbivory~Distance+(1|Population/Subpopulation),
family=binomial)

  See also:

https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q2/002320.html
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2009q2/002335.html