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)

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

enter image description here

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).

  • $\begingroup$ 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? $\endgroup$
    – Stefan
    Jan 19, 2017 at 6:03
  • $\begingroup$ Yes, I have a left and right side and comparing the slopes between both sides. I will add a image of the dataframe $\endgroup$
    – HIL
    Jan 20, 2017 at 2:41
  • $\begingroup$ I updated my answer. This seems to me the right way to specify the model. $\endgroup$
    – Stefan
    Jan 20, 2017 at 3:18

1 Answer 1


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).

  • $\begingroup$ 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. $\endgroup$
    – HIL
    Jan 21, 2017 at 15:50
  • $\begingroup$ @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? $\endgroup$
    – Stefan
    Jan 21, 2017 at 15:56

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.