The trick is to use the fitted() function, not predict(), to get your fitted values. You should then be able to use that vector of values in just the same way that you use your current mean values as below.
Darren Norris wrote: > > > lmodel<-with(a_dataframe,lm(mean_ind~sin(time*2*pi)+cos(time*2*pi))) > plot(time,a_dataframe$mean_ind,pch=".") > lines(time,predict(lmodel)) > > How can I do the same with lmer? I have tried a variety of things with > “predict”, trying to put the results from lmer as a “groupedData” object > etc. But I can’t seem to make it work. Any simple solutions? > Many thanks for any help. > > > -- View this message in context: http://www.nabble.com/How-to-plot-fitted-values-from-lmer-%28lme4-package%29--tp15492920p15495816.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.