random terms in nested mixed effects

I have 300 subjects in 2 conditions and behavioral measures over 6 years. Each subject is measured twice (in each condition) at each time point. I know would like to see if the slopes of condition one over time is different from the slope of condition 2 for the behavioral outcome. (using nlme in R)

would this be correct for the random terms:

    lme(behavior ~ age+condition*time, random=list(~time|subject, ~time|condition), na.action="na.omit", data=mydata)

• No. You don't need time|condition. – amoeba Aug 16 '17 at 14:29
• but if I want to extract the slope of condition1 versus condition 2 (over time), how do I get that? when looking at the [model$coef$random\$subject], I only see one slope per subject ? – HIL Aug 16 '17 at 14:35
• That's the interaction effect condition*time. – amoeba Aug 16 '17 at 14:39
• So would the subject-specific slope of condition 1 (ref) be: age (centered) + fixed estimate of time + random estimate of time for each subject // and the subject-specific slope of condition 2: age (centered) + fixed estimate of time +fixed estimate of condition+ fixed estimate of the interaction + random estimate of time for each subject – HIL Aug 16 '17 at 14:44
• Why do you need any of that? You want to look at the difference in time slopes between conditions. That's given by the condition*time coefficient. You will see it directly in the model output. – amoeba Aug 16 '17 at 14:46