Skip to main content

Unit 11

Introduction

Welcome to Week 11 of BIO144!

Learning objectives for the week

These learning objectives, together with the content of the course book chapter, define what you need to know for the exam.

Chapter 11.1: Mixed models

After this unit, students will be able to:

  1. Recognise grouped, nested or hierarchical data in biological study designs (e.g. repeated measures, individuals within populations, sites within regions).
  2. Explain why ignoring grouping in the data leads to pseudoreplication and overconfident conclusions.
  3. Explain why averaging the repeated measurements within each group before using lm() is sometimes acceptable but often throws away information.
  4. Recognise pseudoreplication when a model’s residual degrees of freedom are much larger than the number of independent units (e.g. individual plants) in the study.
  5. Distinguish fixed effects from random effects, and decide which is appropriate for a variable in a described study.
  6. Distinguish random intercept models from random slope models, and nested from crossed random effects, and write the corresponding lmer() formula.
  7. Explain partial pooling, and how it shrinks group-level estimates towards the overall mean.
  8. Use R to fit linear mixed models with random intercepts, and with random slopes, using lmer() from the lme4 package.
  9. Use R output to obtain the fixed-effect estimates and the variance components.
  10. Interpret mixed model output in biological terms, including what the variance components say about variation among groups.
  11. Explain why degrees of freedom, and so p-values, for fixed effects in mixed models are not straightforward, and that several approximations exist (e.g. Satterthwaite’s method).
  12. Identify limitations and assumptions of mixed models in a described analysis.
  13. Recognise a correct and complete statement of results from a mixed model.

Chapter 11.2: What next?

After this unit, students will be able to:

  1. Describe which kinds of data the methods in BIO144 can analyse: data that meet the assumptions of linear models, count and binary data using generalised linear models, grouped or repeated-measures data using mixed models, and many variables at once using ordination.
  2. Explain why data collected over time or across space often violate the assumption of independent observations, and so require specialised methods (time series analysis, spatial analysis).
  3. Recognise features of a research question or dataset that call for methods beyond BIO144, such as non-independent observations, non-linear relationships, abrupt changes in a relationship, many interrelated variables, time-to-event responses, or results from multiple studies.
  4. Match a described research situation to a suitable family of methods: time series analysis, spatial analysis, non-linear regression, breakpoint analysis, generalised additive models, structural equation modelling, machine learning, meta-analysis, survival analysis, non-parametric methods, power analysis or Bayesian statistics.
  5. Explain why the analysis, including the sample size needed (power analysis), should be planned when the study is designed.
  6. Explain why the choice of analysis should be driven by the research question rather than by the techniques available.

Book chapter

This week we will be covering two chapters of the course book: Chapter 11.1: Mixed models and Chapter 11.2: What next?.

Video and code walkthrough

Each chapter of the course book has a code walkthrough: an R script with the code of the chapter, with comments explaining each step, and a video in which Owen works through the script. Use them to learn the R code you need this week. Work through them before the practical, ideally running the script line by line while you watch the video. The last section of the script (“Practical toolbox”) shows code that the practical uses but the chapter does not. (Chapter 11.2 has no R code, so there is one script and video for this week, for Chapter 11.1.)

Script: walkthrough_ch11_mixed_models.R

To download the script straight into your RStudio project folder (for example on RStudio Server), run this line in the Console:

download.file("https://opetchey.github.io/BIO144_Course_Book/walkthroughs/walkthrough_ch11_mixed_models.R", destfile = "walkthrough_ch11_mixed_models.R")

Video: coming soon.

Lecture

Please attend the lecture. If for any reason you can’t, please watch the podcast, which is available on OLAT.

The second part of the lecture, “Expand your mind: what next?” (course book chapter 11.2), has slides, in two versions:

  • Interactive slides (HTML): open in a web browser. Use the arrow keys to move through the slides, and press F for full screen. Several slides have parts you can try out yourself.
  • Slides as a PDF: for downloading, printing or making notes on.

Optional: some ideas for how you could prepare for the lecture (no preparation is also fine) are in Preparing for lectures.

Homework, Practical, and Weekly Quiz

Available here. You will need to be on a UZH network to access this link, so if you are not on campus, you will need to connect to the UZH VPN first.