0
$\begingroup$

I have a mixed model (using lme in R) with a random intercept.

   model <- lme(HCA ~ time, random=~1|subject, data=mydata)

my supervisor asked me to extract the slopes of HCA for each individual, so that I can use this in another model. I am in doubt here: as I have no random slope, wouldn't the slope be the same for each subject? Or should I add the intercept and the slope of time?

Thanks!

Here is the spaghetti plot

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Why don't you ask your supervisor for clarification? $\endgroup$ – mark999 Sep 20 '16 at 6:31
1
$\begingroup$

Your current model only specifies a random intercept, so you're correct that every subject has the same slope in this model (fixed effect of HCA). Looking at your spaghettiplot it does seem like slopes might be different for each individual. You could try to model a random slope to see if this provides a better fit to your data.

model2 <- lme(HCA ~ time, random=~ 1+ time|subject, data=mydata)

After fitting this model you can compare model fit with anova(model, model2). To get the random slope for each individual you can look at the second column of ranef(model2) (the first being the random intercept). The summary function will give you some more information on the random slope distribution. Under random effects you can find the slope-intercept correlation and the standard deviation of your random effects. Hope this helps.

$\endgroup$
1
$\begingroup$

We can only speculate why your supervisor thinks this is a good idea, but I agree with your first interpretation of his or her instructions. Every subject has the same slope for HCA, which is the fixed effect of HCA. The random intercept and the effect of time play no role here.

$\endgroup$
  • $\begingroup$ The way I understood it is that the individual variability over time may correlate with another variable. I do agree that the slope is the same, but then, when I look at a spaghetti plot, I do see individual slopes... not sure how to get these.. $\endgroup$ – HIL Sep 20 '16 at 5:49
  • $\begingroup$ @HIL Those are individual slopes with respect to time (plus error, of course), not with respect to HCA, and they're not being modeled, since you have no random slope for time. $\endgroup$ – Kodiologist Sep 20 '16 at 14:19

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.