# Specifying a linear mixed effects model with lmer (repeated measures)

We conducted a longitudinal trial with 6 points of measurements using a pretty simple design: Each of the 24 participants completed 16 items at each time of measurement (i.e., 24 participants x 16 items x 6 points of measurements).

For analysis, I want to fit linear mixed effects models using lme4, but I'm still pretty new to this approach (especially regarding nested models). In any case, I would include random effects for subject and item:

model_1 <- lmer(dependent_variable ~ time + (1|participant) + (1|item), data = trial_data)

(Note that just using random intercepts (without random slopes) appears to sufficient based on initial model exploration).

My question: Is the model specification above sufficient or is it neccessary to account for the "nestedness" of the data (i.e., items are nested within points of measurements)?

Thank you very much for any helpful feedback!

Edit: I read a little more on the topic and based on this I assume that the data is by definition not nested. Still, any feedback is welcome.

• Indeed, in your case item and participant are not nested within each other by experimental design. In mixed effect model terms, you can think of them coming from two independent distributions and then being combined across all possible combinations: each participant does each item. See also here: stats.stackexchange.com/questions/228800/… Jul 29, 2020 at 12:35

Another way to think about these random intercepts is to imagine that you want to account for correlations of responses by the named factors. In your model, you have the following:

1. A random intercept for participant, indicating that you believe that responses (dependent_variable) from the same individual are expected to be more highly correlated than responses from different individuals.
2. A random item intercept that accounts for your belief that responses to the same item are expected to be more highly correlated than responses to two different items.

You might further believe that the same individual responding to the same item repeatedly would introduce further correlation that you have not accounted for. To deal with such a problem, you would introduce a third random intercept (1|participant:item). You can use likelihood ratio testing (R's anova() command) of nested models to determine if such an interaction intercept is needed:

model_1 <- lmer(dependent_variable ~ time + (1|participant) + (1|item), data = trial_data)
model_2 <- lmer(dependent_variable ~ time + (1|participant) + (1|item) + (1|participant:item), data = trial_data)
anova(model1, model2)


A significant $$\chi^2$$ value would be evidence in support of the more complicated model_2.

• Interesting, thank you! I will try it out.
– Tee
Jul 30, 2020 at 10:46
• Just so you know: I've now included the interaction term and the model fit is indeed better. Thank you very much!
– Tee
Jul 31, 2020 at 7:58