I would like to fit a three level autoregressive model in lme4 to account for my longitudinal experience sampling data (beeps nested in days, nested in persons).

Several resources suggest to account for a three level data structure by including a random term with a "/":

threelevel.AR.1 <- lmer(affect ~ ∼1 + lev2pred + lev1predfor3l +
                (1 + lev2pred + lev1predfor3l | PersonF/DayF), 

De Haan-Rietdijk et al. (2016), however, suggest to build the model as follows:

threelevel.AR.2 <- lmer(affect ∼1+lev2pred+ lev1predfor3l +
(1 | PersonF/DayF) + (1 + lev2pred + lev1predfor3l | PersonF),
data = ESM, REML = FALSE)

My questions are:

1 - What is the difference between the two models?

2 - Would it be correct to use the first model?


The full citation for the paper is: de Haan-Rietdijk, S., Kuppens, P., & Hamaker, E. L. (2016). What’s in a Day? A Guide to Decomposing the Variance in Intensive Longitudinal Data. Frontiers in Psychology, 7. https://doi.org/10.3389/fpsyg.2016.00891


1 Answer 1


First it's important to note that in lmer, (1+A+B|person/day) is a short way to write (1+A+B|person) + (1+A+B|person:day). Therefore, the first model estimates random intercepts and slopes for each person, and for each combination of person and day. This is equivalent to the assumption that each person comes with a set of random intercepts and slopes that, on average, stay the same across all days. However, each day "within" a person is also allowed to bring its own full set of random effects, so that on each day, the relationship between independent variables and response can be slightly different from the "average" response pattern of that person.

The second model does also estimate random intercepts and slopes for each person, but on the level of days, only a random intercept is estimated. This implies the assumption that each person comes with a certain response pattern, which differs between days only by a constant shift. So on each day, the mean of the responses might be somewhat higher or lower than "usual" for that person, but the relationship between the independent variables and the response does not change.

In my opinion, both models imply reasonable assumptions about the population - the decision if one of them is "better"/more useful than the other should be informed by theoretical knowledge. Empirically, you could assess if one of the models fits the data better than the other by means of model comparisons (likelihood test or AIC/BIC). My first hunch would be that Model 1 might be too complex for many "real" datasets.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.