[R] Plot lmer model with Effects package

John Fox jfox at mcmaster.ca
Sat Oct 27 04:07:16 CEST 2012


Dear Marte,

On Thu, 25 Oct 2012 16:11:07 +0200
 Marte Lilleeng <mlilleeng at gmail.com> wrote:
> Hi everyone!
> I have a simple model that i would like to plot with 95% CIs.
> It is like follows:
> m1<-lmer(Richness~Grazing+I(Grazing^2)+(1|Plot),family=poisson)
> 
> By using the effects package I get two plots, one for the linear term
> and one for the squared term.
> Q1: Can I get all in one? I.e. with one line for the whole model?

It's better to specify the model as Richness~poly(Grazing, 2)+(1|Plot) so that effect() understands that the quadratic is a single term in the model. Alternatively, I believe that Effect() would work as you want for either form.

> Q2: Can I also visualize the random effects?

I'm not sure what that would mean. I suppose that you could look at the distribution of the BLUPs.

I hope this helps,
 John

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/

> 
> I would be very happy for your answers!
> 
> -- 
> Mvh Marte S. Lilleeng
> 
> ______________________________________________
> 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.




More information about the R-help mailing list