Mixed effects models

Author

Vicki Hodgson*, Hugo Tavares, Paul Fannon, Martin van Rongen

Published

September 19, 2024

Overview

This course provides an introduction to linear mixed effects modelling.

Please be aware that this course is in development and the contents of this site are likely to change in future.

Learning Objectives
  • To understand the motivation for using linear mixed models, and when it is appropriate to include random effects
  • To fit a mixed model to a hierarchical dataset
  • To visualise mixed models
  • To evaluate model fit using significance testing and diagnostic plots

Target Audience

This course is aimed primarily at postgraduate students and postdoctoral researchers in the life sciences.

Prerequisites

You should have a working knowledge of R/RStudio, and a grasp of core statistics content, in particular the linear modelling framework.

Exercises

Exercises in these materials are labelled according to their level of difficulty:

Level Description
Exercises in level 1 are simpler and designed to get you familiar with the concepts and syntax covered in the course.
Exercises in level 2 combine different concepts together and apply it to a given task.
Exercises in level 3 require going beyond the concepts and syntax introduced to solve new problems.

Citation & Authors

Please cite these materials if:

  • You adapted or used any of them in your own teaching.
  • These materials were useful for your research work. For example, you can cite us in the methods section of your paper: “We carried our analyses based on the recommendations in YourReferenceHere”.

You can cite these materials as:

Hodgson, V., Tavares, H., Fannon, P., van Rongen, M. (2024). Mixed effects models. https://cambiotraining.github.io/stats-mixed-effects-models

Or in BibTeX format:

@misc{YourReferenceHere,
  author = {Hodgson, Vicki and Tavares, Hugo and Fannon, Paul and van Rongen, Martin},
  month = {7},
  title = {Mixed effects models},
  url = {https://cambiotraining.github.io/stats-mixed-effects-models},
  year = {2024}
}

About the authors:

  • Vicki Hodgson
    Affiliation: Cambridge Centre for Research Informatics Training
    Roles: writing - original draft, review & editing; conceptualisation; coding
  • Hugo Tavares
    Affiliation: Cambridge Centre for Research Informatics Training
    Roles: writing - review & editing; conceptualisation; coding
  • Paul Fannon
    Affiliation: Cambridge Centre for Research Informatics Training
    Roles: conceptualisation
  • Martin van Rongen
    Affiliation: Cambridge Centre for Research Informatics Training
    Roles: conceptualisation

References

Baath, R. (2024, 28 January). The source of the cake dataset. https://www.sumsar.net/blog/source-of-the-cake-dataset/

Bolker, B. (2023, 8 October). GLMM FAQ. https://bbolker.github.io/mixedmodels-misc/glmmFAQ.html

Choe, J. (2020). The Correlation Parameter in the Random Effects of Mixed Effects Models. https://rpubs.com/yjunechoe/correlationsLMEM

Cook, F. E. (1938). Chocolate cake: I. Optimum baking temperature. (Doctoral dissertation, Iowa State College).

Faraway, J. J. (2016). Extending the linear model with R: generalized linear, mixed effects and nonparametric regression models. Chapman and Hall/CRC.

Hadjuk, G. K. & Gallois E. (2022, 9 February). Introduction to linear mixed models. Our Coding Club. https://ourcodingclub.github.io/tutorials/mixed-models/

Oehlert, G. W. (2010). A first course in design and analysis of experiments. https://conservancy.umn.edu/server/api/core/bitstreams/87e0734d-31ea-4596-8295-d87705271c07/content

Winter, B., & Grawunder, S. (2012). The phonetic profile of Korean formal and informal speech registers. Journal of Phonetics, 40(6), 808-815.