# mixed models: nested design

I have longitudinal data (4 year follow-up) of brain volume. I now want to investigate whether the change over time of brain volume differs between left and right sides (the idea is that in the disease that I investigate that the right side might show steeper decline in volume over time).

I have reshaped my data in longitudinal format in such a way that time and side are long (so 8 rows per subject). Now I want to run mixed models, but I am wondering whether my model is correct:

model = lme(Brainvol ~ Age + time * side, random=~1|ID, na.action="na.omit", data=long)
summary(model)


Would this be correct? Should I add side as random intercept? I have 150 subjects.

The image shows the organization of the data: SID (subject identifier), times (longitudinal measures, three time points shown), Hipp (volume of a region of the brain), side (left and right).

• I am just reading your question again, did you measure Brainvol for both hemispheres in each subject? If so we should add this in your random term. However this depends on how your data is structured. Would you be able to add a snippet of your data table? – Stefan Jan 19 '17 at 6:03
• Yes, I have a left and right side and comparing the slopes between both sides. I will add a image of the dataframe – HIL Jan 20 '17 at 2:41
• I updated my answer. This seems to me the right way to specify the model. – Stefan Jan 20 '17 at 3:18

Yes I would account for side, which was measured twice per ID and time, into your random term. This can be achieved by nesting time in ID, i.e. random=~1|ID/time. In the summery(model) output you can also find a line where it says Number of Observations and Number of Groups. There you can see whether your grouping, specified in the random term, makes sense.
You might also consider adding random slopes for age, i.e. random=~1+age|ID/time if you would expect variations in Brainvol that dependent on the age of your subjects. I am not sure though whether this will work computationally. I guess you will see when you try.