# 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

## 1 Answer

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.

To test which random structure fits your data best, you could compare the AIC between the two models (the lower the better, but the also here, and here regarding use of the AIC for model selection procedures).

• Thanks! Random slopes for age was indeed not possible, I think I don't have enough df for that? But nesting time in the random ID term works perfectly. Thanks. – HIL Jan 21 '17 at 15:50
• @HIL Yes I think the number of replicates at this grouping are too low for this to work. Probably due to updating the age of each subject according to the year of the follow up. I am assuming the age of each subject will change over the time period of the follow ups? – Stefan Jan 21 '17 at 15:56