I'm trying to analyse some data from a set of bird surveys. My response variable is "bird abundance", which is the number of birds counted over a five-minute period. These five-minute counts were conducted at ~200 sites. Counts were repeated three times at each site, although there are ~20 sites where only two counts were completed. I want to model bird abundance as a function of site-level attributes (habitat quality etc) as well as Count-level attributes (weather conditions at the time of the count etc).

So, I have ~200 sites and ~600 individual counts, but only 2-3 counts per site. My question is: given that I only have 2-3 counts per site, can I include site as a random factor to account for the nonindependence of counts within sites? (note I can drop the sites that have only two counts if necessary).

I've read conflicting information about the number of observations that you need within each level of the random factor. Ben Bolker’s paper on GLMMs in Trends in Ecology and Evolution says "5-6 random effect levels per random effect and 10-20 samples per treatment level or experimental unit", but then I've also read stuff that suggests using mixed models for repeated measures designs that take a pre-treatment, post-treatement, and follow up sample - ie only three observations within each level of the random effect.

Thanks for the help!


  • 2
    $\begingroup$ Are the "site" effects of interest to you? Or is it more that you want to take account of possible correlation within the sites? Also do you expect to find "really good" sites and "really poor" sites? If you do, then you may find standard GLMM will overshrink these outlying sites. $\endgroup$ Commented Aug 13, 2013 at 10:30

2 Answers 2


There's nothing about a random or mixed effects model that requires having a certain number of observations per level. In fact, if you have many observations per level then the random effect may not be necessary and you may be able to just include that as a factor variable.

You should be able to just specify the site as a random effect variable and proceed, and it shouldn't negatively affect the quality of your inference. As you note in the comment, the standard GLMM with the lme4 package ought to work fine for this.

  • 1
    $\begingroup$ This is very contrary to my understanding on random effects in 2 points: 1) I was under the impression that you had to have enough samples to make a reasonable estimate of variance, both within and between the levels (5-7 levels and samples within each level depending on who you ask in my experience). 2) if you have many observations per level ... you may be able to just include that as a factor variable, using the variable as a fixed effect will increase the degrees of freedom and lower the strength of your model... This defeats the point of using random effects in the first place,no? $\endgroup$
    – user35780
    Commented Oct 8, 2017 at 12:17
  • $\begingroup$ Indeed. To expand on RTbecard's comment, consider also: Brauer, M., & Curtin, J. J. (2018). Linear mixed-effects models and the analysis of nonindependent data: A unified framework to analyze categorical and continuous independent variables that vary within-subjects and/or within-items. Psychological Methods, 23(3), 389–411. psych.wisc.edu/Brauer/BrauerLab/wp-content/uploads/2014/04/… $\endgroup$ Commented Dec 20, 2020 at 10:22

you can include the sites with only two counts in your analysis.

One way is to create a multi-level model, assign prior distributions to all the observables and then use the data to update to the posterior distribution (essentially a bayesian analysis). For guidance, look at (Gelman, Hill 2006) and the tutorials for using STAN.

One keyword to look for is "data imputation" to handle missing values.

  • $\begingroup$ Hi momeara, thanks for that info. You're suggesting I do what seems to be a fairly sophisticated analysis (for my level of expertise). I take it that this means that it's inappropriate to use a more straightforward approach (e.g. Running a "standard" GLMM using lme4 in R) with only 3 observations within each level of the random effect? Cheers $\endgroup$
    – jay
    Commented Aug 12, 2013 at 20:17
  • $\begingroup$ i.e. I don't mind dropping the sites with only two counts – there aren't that many of them – but what I am concerned about is the fact that three observations per random effect level may not be enough to properly fit a GLMM. Cheers $\endgroup$
    – jay
    Commented Aug 12, 2013 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.