Mixed-effect models (MEMs) are useful to deal with unbalanced study designs and/or with non-independent data. In the context of MEMs, explanatory variables are distinguished in fixed effects and random effects. As a practical and brutal definition, a model’s fixed effects are the explanatory variables the effect of which we are interested to quantify explicitly; a model’s random effects are variables that are not the main focus of our study but that we want to account for because we expect them to explain some of the residual variability (more on fixed and random effects: here, here). We can think of random effects as sources of background noise that is important to estimate in order to obtain a more accurate estimate of the fixed effects. Mixed-effect models allow to specify explanatory variables as fixed or random, which are then modelled accordingly.
Some literature references for getting started:
- “A brief introduction to mixed effects modelling and multi-model inference in ecology” by Harrison et al. (2018).
- An excellent book for understanding MEMs and implementing them in R is A Beginner’s Guide to GLM and GLMM with R: A Frequentist and Bayesian Perspective for Ecologists by Alain F. Zuur, Joseph M. Hilbe, and Elena N. Leno.
- A worked example on how to analyse data with a mixed-effect model by Ignasi Bartolomeus (the issue with his example is that the random effect has only three levels. While this is helpful for teaching purposes, they recommend random effects to have at least 5-6 levels for them to give reliable estimates).