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

From: jebyrnes <jebyrnes_at_ucdavis.edu>
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: 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_at_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.
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 https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive