## Using the GUI (6): Spatial Mapping Using Linear Mixed Models

### Linear Mixed Modelling in *i*Map4

A pop-up will ask for the already saved FixMap, PredictorM, and Mask after you click on the **Linear Mixed Model**.

Then you can select your fixed effect (main and/or interaction) and random effect.

The linear formula can be further specified by clicking **Edit Formula**. In the following example the formula for the LMM is

*PixelIntensity ~ Spotlight + Position + Spotlight:Position + (fixdur|subject)*

If you would like to perform **Linear Contrast** later on, set **singlepredi** to 1. Also if your machine has access to Distributed Computing Servers you could input the cluster name in **parallelname** (*i*Map4 will connect to local cluster by default if your machine equips with parallel toolbox).

Moreover, you can specify the option for linear mixed model fitting. The input arguments accept by *i*Map4 is identical to the *LinearMixedModel* class in Matlab. For more information please check:

http://www.mathworks.com/help/stats/fitlme.html

To proceed to the modeling, click **Run Model**. A pop-up will prompt you to rename the result for saving when the modeling finishes.

Details on parameter estimation please refer to McCulloch, Searle & Neuhaus (2011) and Pinheiro & Bates (2000) as well as the Matlab help documents

http://www.mathworks.com/help/stats/estimating-parameters-in-linear-mixed-effects-models.html

*Please note: iMap4 fits a linear mixed model for each pixel within the mask, and it’s usually a very slow process. Please be patient when this step is running.*

Well, now that *i*Map4 is running, you can go get a cup of tea and check you Facebook ;-)
Alternatively, check our Github page to see other exciting projects we are currently working on.