Re: [R] How to plot fitted values from lmer (lme4 package)?

From: jebyrnes <>
Date: Thu, 14 Feb 2008 23:04:25 -0800 (PST)

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:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 15 Feb 2008 - 07:08:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 15 Feb 2008 - 07:30:14 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive