Mixed Effects Models

(Ecological and biological) data are often complex and messy

Different grouping factors (populations, species, sites, …)

Sample sizes may be small …

… especially if we try to fit complicated models with many parameters

Data points might not be truly independent

Grouping factor information

Traditional approaches

1. Take averages

2. Run multiple smaller models

Or, we could include it directly in a model

m <- glm(y ~ x + species)

But, we don’t really care about species

m <- glm(y ~ x + species)

We just want to account for average differences among species

i.e., control for the variation coming from species

Mixed effects models can help!

Allow us to

Fixed vs random

It depends …

Variables can be either, or both!

Not totally agreed on: see here

Fixed effects are

variables that we expect will have a direct effect on the dependent/response variable

Random effects are

Ask some questions of your questions:

  1. What are you trying to do?

  2. What are you trying to make predictions about?

  3. What is just variation (a.k.a “noise”) that you need to control for?

More details

interwebs

https://ourcodingclub.github.io/2017/03/15/mixed-models.html

http://scs.math.yorku.ca/index.php/Mixed_Models_with_R/Introduction_to_Mixed_Models

glmm.wikidot.com

https://www.jaredknowles.com/journal/2014/5/17/mixed-effects-tutorial-2-fun-with-mermod-objects

https://www.jaredknowles.com/journal/2015/8/12/announcing-mertools

books

Gelman & Hill (2007) Data Analysis Using Regression and Multilevel/Hierarchical Models. webpage

Pinheiro, José C., and Douglas M. Bates. 2000. Mixed-Effects Models in S and S-PLUS. New York: Springer.

Zuur, Alain F., Elena N. Ieno, Neil J. Walker, Anatoly A. Saveliev, and Graham M. Smith. 2009. Mixed Effects Models and Extensions in Ecology with R. Springer.

Dobson, Annette J., and Adrian Barnett. 2008. An Introduction to Generalized Linear Models, Third Edition. 3rd ed. Chapman; Hall/CRC.

Faraway, Julian J. 2006. Extending Linear Models with R: Generalized Linear, Mixed Effects and Nonparametric Regression Models. Chapman & Hall/CRC.

McCullagh, P., and J. A. Nelder. 1989. Generalized Linear Models. London: Chapman; Hall.