[R-sig-ME] A question

538280 at gmail.com 538280 at gmail.com
Fri Feb 10 17:25:35 CET 2012


Assuming that you are using the lme function from the nlme package,
you probably want to look at the augPred and plot.augPred functions in
the same package for more meaningful ways to make and plot predictions
from mixed effects models.

On Wed, Feb 8, 2012 at 9:13 AM, sheida sarafzade <shsarafzade at gmail.com> wrote:
> Hello
> I'm MSc. student in biostatistics and working on mixed effect models
> I’m trying to add fitted line to scatter plot (x,y)
> Here “weight” is dependent variable and “month” is time variable.
> The program is:
> Lme1<-Lme(weight~month+(month^2),data=DataSetName,random=~month|id)
>
> When I use the code below:
> Lines(month[order(month)],fitted.lme(lme1,level=0)[order(month)])
>
> It draws a smooth line but when I add a covariate (like birth weight)
> to my model as below:
>
> Lme2<-lme(weight~BirthWeight+month+(month^2),data=DataSetName,random=~month|id)
>
> And then write the code below:
> Lines(month[order(month)],fitted.lme(lme2,level=0)[order(month)])
>
> It doesn’t draw smooth line. the line is not smooth.
>
> How can I fix this problem?
> What is the role of term “level” in this code? And what are it’s option?
>
> for more information please see attachment
> Thanks a lot
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com




More information about the R-sig-mixed-models mailing list