[R] contrasts for lmer model

Max Kuhn mxkuhn at gmail.com
Wed May 19 16:37:33 CEST 2010


Basically, I haven't gotten around to adding a contrast.lmer methods
yet. It's only my list, but in the short term, you are welcome to
contribute code to the package.

There have also been discussions on this list about the
appropriateness of such contrats with nonlinear models, but I need to
implement the contrast anyway (to handle the linear cases).

Max

On Wed, May 19, 2010 at 9:23 AM, Kay Cichini <Kay.Cichini at uibk.ac.at> wrote:
>
> plugged it together myself -
> obviously this should work:
>
> m0<-lm(rich ~ gap*stage,data=richness)
>
> cc<-contrast(m0,
> list(stage = levels(stage), gap = "1"),
> list(stage = levels(stage), gap = "0"))
>
> # plug in matrix from contrast(m0)
> summary(glht(m3, linfct = cc$X))
>
>
>         Simultaneous Tests for General Linear Hypotheses
>
> Fit: glmer(formula = rich ~ gap * stage + (1 | site), family = poisson,
>    REML = 1)
>
> Linear Hypotheses:
>       Estimate Std. Error z value Pr(>|z|)
> 1 == 0  0.04820    0.15594   0.309   0.9965
> 2 == 0 -0.44679    0.10204  -4.379 4.78e-05 ***
> 3 == 0 -0.52847    0.09133  -5.786 2.88e-08 ***
> 4 == 0 -0.44396    0.15549  -2.855   0.0171 *
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> (Adjusted p values reported -- single-step method)
>
> -----
> ------------------------
> Kay Cichini
> Postgraduate student
> Institute of Botany
> Univ. of Innsbruck
> ------------------------
>
> --
> View this message in context: http://r.789695.n4.nabble.com/contrasts-for-lmer-model-tp2222682p2222820.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.
>



-- 

Max



More information about the R-help mailing list