6.1 Introduction
The General Linear Models we have used in chapters 3, 4 and 5 are highly flexible, but there are some situations where their suitability breaks down. The first of these is when the outcome variable is not continuous; for example, it is an event that either happens or does not. The second is when the data points are clustered; for example, several observations belong to the same participant, as in a longitudinal study, or an experiment with a within-subjects design.
Fortunately, there are two extensions to the General Linear Model that allow us to model these situations without changing our approach too drastically. For the case of the non-continuous outcome, we can use a Generalized Linear Model. For the case of clustering, we can use a Linear Mixed Model. And, if we find ourselves with data where the outcome is not continuous and there is clustering, then we can deploy both extensions at the same time, giving us the Generalized Linear Mixed Model. This chapter introduces Generalized Linear Models and Linear Mixed Models, working through a data example with each one.