Chapter 13 Introduction to GLMM

Generalized linear mixed models (GLMM) are an extension of generalized linear models (GLM) that account for additional structure in dataset.

They follows similar steps to those we just introduced with linear mixed models (LMM):

  • 1. Incorporate random effects (like LMMs)

  • 2. Handle non-normal data, letting errors take on different distribution families - e.g. Poisson or negative binomial (like GLMs; Workshop 6)


As with the LMM portion of this workshop, we are going to work through the GLMM material with a dataset in order to better understand how GLMMs work and how to implement them in R.

In the Arabidopsis dataset, the effect of nutrient availability and herbivory (fixed effects) on the fruit production (response variable) of Arabidopsis thaliana was evaluated by measuring 625 plants across 9 different populations, each comprised of 2 to 3 different genotypes (random effects).

Start by importing the Arabidopsis dataset banta_totalfruits.csv into R.

dat.tf <- read.csv("data/banta_totalfruits.csv")

# In this dataset, the column headers are defined as: popu
# factor with a level for each population gen factor with a
# level for each genotype nutrient factor with levels for
# low (value = 1) or high (value = 8) amd factor with
# levels for no damage or simulated herbivory total.fruits
# integer indicating the number of fruits per plant