Chapter 4 Random effects - LMM, GLMM, CLMM, GAMMs
This chapter introduces the reader to the basics of mixed-effects regressions. We explore what random effects are and how they contribute to our models. It demonstrates how what additional information we gain from a mixed effects model beyond the fixed effects. We heaviliy explore random effects using a Linear Mixed-Effects Regression model (LMM) using the package lme4
. We also explore how to use the ggstats
and ggstatsplot
packages to visualise the results of our models. We also use the sjPlot
package to visualise the results of our models. We explore other family distributions using Generalised Linear Mixed-effects Models (GLMMs) using the lme4
package. Here we use various types of predictors: categorical predictors and numeric predictors. For the latter case, we look at how to use z-scored numeric predictors. We also explore how to use the emmeans
package to visualise the results of our models. We then move to a cumulative link mixed-effects models (CLMMs). Towards the end, we introduce the user to Generalised Additive Mixed-effects Regressions (GAMMs). We use the package mgcv
to explore how to use GAMMs. We also explore how to use the itsadug
package to visualise the results of our models.