# mixed models: extract slopes

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

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

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.