Skip to content
Prev 247803 / 398503 Next

Help with logistic model with random effects in R

LAURA WEIR <0611792W <at> student.gla.ac.uk> writes:
I'm a little confused about your experimental design.  You say you
have 10 replicates per group, but I only see 36 observations in your
data set -- from your description I would have expected 360?

If you had 10 replicates per group I would say should do something like

glmer(Catchability~[fixed effect predictors]+(1|Group/Individual),
   family=binomial,data=data)

  A couple of other points:
* it's considered bad practice to name your data set 'data' (which is
also the name of a built-in R function).  Usually it's OK, but occasionally
it could cause problems.
* A rule of thumb is that you should not try to fit a model with
more than k=N/10 parameters, where for binary data 'N' is the minimum
of (number of successes, number of failures).
* 6 groups is at the lower edge of feasibility for fitting a random
effect -- you may find that glmer estimates the group-level variance
as zero. (Don't panic.)

  I would suggest that you send follow-ups to r-sig-mixed-models at r-project.org
and possibly take a look at <http://glmm.wikidot.com/faq>

  cheers
    Ben Bolker