Week 8: Mixed effects models

Everything we have discussed so far in class assumes that each replicate is independent. In ecology that assumption is often not met. Observations can be nested within sites or transects, and individuals can be sampled more than once.

In this week we will learn how to deal with non-independence using mixed effects models.

Lecture Topics

  • The problem of non-independence
  • Random vs. fixed effects
  • Introducing the mixed effect model
  • How to specify random effects in R

In-class Activities

There will be a mixture of R code and lecture.


Much ink has been spilled on this topic. Some particularly useful lectures are:

There is also a brand new pre-print that looks to be an excellent resource on this topic:

I cite this book a lot in this class, but where random effects are concerned their reference guide is especially useful:

Bonus: Want to get an R squared value from your mixed effects model? See:




Slides available on Speakerdeck