Skip to content

Linear Mixed Models

Junpeng Lao edited this page Aug 18, 2016 · 5 revisions

Linear Mixed Model - a brief demo:

In a GLM setting,

y = Xβ + ε

only ε is the random effect:

regression1

ε is normally distributed and has a mean of zero. If you applied regression with such assumption, then it doesn't matter your data is actually from multiple subjects:

regression2

The data are the same as above, with each subject outlined in different color

In real life research, things usually get messy, for example:

example2-orig

or

example2-orig

And these situations can be handle perfectly in a Linear Mixed Model, which expressed these effect as random:

y = Xβ + Zb + ε

In example2-orig, we can expressed the subject intercept as the random effect, which gives us a random intercept model.

In example2-orig, we just add the fixed predictor as a separate column into the Z from above, returning a random intercept and slope model.

And the same could be applied with categorical predictor, for example, a random slope model below (with no random intercept):

example2-orig

Using linear mixed model, you can take into account effect such as mixed-effect (i.e., both within- and between- subject effect) and repeated measurements. And with iMap4, you can now applied this powerful model on your eye tracking data as well!

Mixed models are a complex subject and many underlying details are beyond the scope of this paper. For a general thoughtful introduction to mixed models, users of the toolbox should refer to Raudenbush & Bryk (2002) and McCulloch, Searle & Neuhaus (2011).


Linear Mixed model in Matlab

iMap4 calls LinearMixedModel from Matlab for model estimations. You can find the relate concepts in Matlab help file:

Linear Mixed-Effects Models

This page explains the basic concept of Linear Mixed Model.

Estimating Parameters in Linear Mixed-Effects Models

This page explains the methods for estimating parameters in Matlab: Maximum likelihood estimation (ML) and Restricted maximum likelihood estimation (ReML).

Linear formula notation (Wilkinson Notation)

This page explains how to express your linear formula.

Clone this wiki locally