# Repeated measures with nested data in R

Previously, I conducted a model like the following. I have repeated measures (Time factor: pre-post) of depressive mood in two different groups (Group factor: neutral and experimental). Each participant in only one group. I checked the Coping as a moderator.

lmer(DepressiveMood ~ Coping*Time*Group + (1|ID), data = data)


Currently, I created 3 Levels among the participants based on their pre-depressive mood scores as a low, average, and high depressive mood. So, the difference can be more sizeable. However, I could not create the model. Is this following model correct? My question is individuals in three different levels of depressive mood (Level factor) are different?

lmer(DepressiveMood ~ Coping*Time*Group + (1|Level|ID), data = data)


If you are using lme4 (do you?) and you wanted to have a random effect for the interactions of Level and ID, you would use:
lmer(DepressiveMood ~ Coping*Time*Group + (1|Level:ID), data = data)
(note the colon : instead of the bar |).
If you want an extra random effect both for Level and ID, separately, use:
lmer(DepressiveMood ~ Coping*Time*Group + (1|Level) + (1|ID), data = data)