0
$\begingroup$

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)
$\endgroup$
  • 1
    $\begingroup$ No. You don't need time|condition. $\endgroup$ – amoeba Aug 16 '17 at 14:29
  • $\begingroup$ 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 ? $\endgroup$ – HIL Aug 16 '17 at 14:35
  • $\begingroup$ That's the interaction effect condition*time. $\endgroup$ – amoeba Aug 16 '17 at 14:39
  • $\begingroup$ 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 $\endgroup$ – HIL Aug 16 '17 at 14:44
  • $\begingroup$ 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. $\endgroup$ – amoeba Aug 16 '17 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.