I am trying to fit a multilevel longitudinal model and i have a question regarding how to specify it.
The data consist of about 8k observations collected from about 3k individuals at four time points. Individuals are nested in groups and there are about 200 groups. I have two different types of fixed effects: (a) repeated measures at the observation level (e.g. pred1.obs ), and (b) group level predictors that also change over time (e.g. pred2.grp). Because each group level fixed effect is also longitudinal there are 800 values (4x200 which are repeated for each member of the group at that time) but there are only 200 groups.
My question is what would be the correct specification for this model and why? e.g:
1: lmer(outcome ~ time + pred1.obs + pred2.grp + (time|id) + (time|grp))
2: lmer(outcome ~ time + pred1.obs + pred2.grp + (time|id) + (1|grp:time))
3: lmer(outcome ~ time + pred1.obs + pred2.grp + (time|id) + (time|grp) + (1|grp:time))
Thus, would lme4 correctly estimate the model if i use (time|grp) or do i need to use (1|grp:time) or the combination?
Or something else that i haven't thought of?
Many thanks, George