[R] marginal effect lmer

John Fox jfox at mcmaster.ca
Mon Jul 23 15:43:57 CEST 2012


Dear Andigo,

You don't say what problems you encountered, and I don't know how to interpret the superscript 2s in your lmer() command, but if the intention is to fit a quadratic in Catholicproportion, then you can use poly(Catholicproportion, 2) in formulating the model. That way, effect() will be able to figure out the structure of the model. BTW, the "effects" computed by effect() are not what are commonly called "marginal effects," but rather fitted values under the model for particular combinations of predictors.

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/
	
On Mon, 23 Jul 2012 02:46:32 -0700 (PDT)
 Andigo <Andreas.Goldberg at unige.ch> wrote:
> Hi everybody,
> 
> I try to calculate and display the marginal effect(s) in a hierarchical
> model using lmer. Here is my model:
> 
> m1<- lmer(vote2011~ Catholic + Attendance+ logthreshold + West +
> Catholicproportion+
>   (Catholic * Catholicproportion) + (Attendance*Catholicproportion) +
> Catholicproportion²+ (Catholic *Catholicproportion²)+
>   (Attendance* Catholicproportion²) + (1 + Attendance+ Catholic | canton),
> data=dat2011, verbose = T)
> 
> I want to display the me of the individual level variable Catholic depending
> on the contextual variable Catholicproportion (showing also the 95% ci). So
> far I tried a bit with the "effects" package, but without success.
> 
> Does anybody know how to display that?
> 
> Thanks in advance for your help!
> 
> Andigo
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/marginal-effect-lmer-tp4637421.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.



More information about the R-help mailing list