# random effects structure in lme4 model

I am designing an Experiment and am struggling with the random effects structure of my lme4 model. In short, I measure the Evaluation on 48 items (100-point scale) for each of 65 participants. The Evaluation of each item is measured before (t0) and after (t1) a Training.

The 96 items are for each participant chosen from a universe of 140 items in total, and might therefore (but do not necessarily) differ for each participant.

In the training, each item is assigned 1 out of 3 attentional cueing conditions (factor, 3 levels[0,1,2]). Each cell contains 16 items.

I am interested in the difference in evaluation of each item from t0 to t1, and whether it depends on the attentional cueing condition. My suggested model (in lme4 Syntax) is:

lmer(evaluation ~ time*cueing + (1 + time*cueing | participant) + (1 | item)).


However, I am not sure whether this is the right way to specify that I am interested in the difference in Evaluation per individual item. To be clear, I am not interested in fixed effects for items, but I wonder whether it is important for the model to compare item 1 at t0 with item1 at t0 within each participant. Do I maybe have to add random slopes on the item Level, even if the items are not the same for each participant and might be assigned to different conditions for each participant?

Therefore, I wonder whether I would have to nest the items within each participant with (1 + time*cueing | item:participant).

Does anyone have any suggestions?

Perhaps I don't fully understand the complexity of your research questions, but if you are interested in

• The effects of cueing and
• The effect of training

then the specicification is simply:

fm1 <- lmer(evaluation ~ time + cueing + (1 | participant) + (1 | item))


This will give you a scalar value for the average effect of training, and a scalar value for each dummy variable created by cueing.

If you want know if training helps more for some cues than for other cues, then an interaction of the fixed terms can be included in the model

fm2 <- lmer(evaluation ~ time*cueing + (1 | participant) + (1 | item))


This model gives

• The effects of cueing with and without training.
• The effects of training for each cue.

The specification you originally presented

fm3 <- lmer(evaluation ~ time*cueing + (1 + time*cueing | participant) + (1 | item))


is perfectly valid, but it is perhaps overly complicated, since it estimates an individual (random) effect of each combination of cueing and training. Use the loglikelihood ratio test with anova(fm2, fm3) to find out if that is really warranted, or if the simpler model is to be prefered.

Your question: "Therefore, I wonder whether I would have to nest the items within each participant with (1 + time*cueing | item:participant)" is an empirical question - it can only be answered after seeing the data. In your case the random effects are only nuisance terms, they are only included in order to enhance the estimation of the fixed effects (and the standard errors of the fixed effects), the random effects are not interesting per se. Therefore, just use the level of complexity on modelling the random terms which is necessary, and use anova() to rule out that a simpler modelling is sufficient.

Only if anova(fm1, fm2) yields a signficant result (ie that fm2 is significantly better than fm1), go ahead and try even more complex random terms.