[R-sig-ME] Output glmer
Ben Bolker
bbolker at gmail.com
Tue Mar 10 14:45:13 CET 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 15-03-10 07:01 AM, Davide Bellone wrote:
> Good afternoon,
>
> I have a little problem in my glmer output. In my model, before run
> the model I used
>
> options(contrasts=c("contr.sum", "contr.poly"))
>
> So after stepwise deletion I arrive at the finel output:
First of all, I would caution against stepwise deletion (see e.g.
Frank Harrell's book _Regression Modeling Strategies_, or Google
"stepwise regression problems"
> Formula: y ~ Model$Manage + Model$age + Model$veg + Model$wood +
> Model$under + Model$veg * Model$Manage + Model$age * Model$veg +
> Model$under * Model$wood + Model$veg * Model$under + (1 |
> Model$Site) + (1 | obs)
Second, I would suggest that you leave the "Model$" out of your
formula, and that you recognize that * incorporates both main effects
and interactions: your model can be written more simply as
y ~ Manage + age + veg + wood + under + veg:Manage + veg:age +
under:wood + under:veg + (1|Site) + (1|obs)
or even
y ~ veg*(Manage+age + under) + under*wood + (1|Site) + (1|obs)
(there is one redundant term here -- the main effect of under is
incorporated in both terms -- but R will take care of dropping it
automatically)
or better, retain all two-way interactions:
y ~ (veg+Manage+age+under+wood)^2 + (1|Site) + (1|obs)
>
> AIC BIC logLik deviance df.resid 568.0 604.1 -272.0
> 544.0 138
>
> Scaled residuals: Min 1Q Median 3Q Max -0.76077
> -0.15913 0.00041 0.26754 0.70326
>
> Random effects: Groups Name Variance Std.Dev. obs
> (Intercept) 11.954 3.458 Model$Site (Intercept) 7.405 2.721
> Number of obs: 150, groups: obs, 150; Model$Site, 10
>
> Fixed effects: Estimate d. Error z value Pr(>|z|) (Intercept)
> 16.67112 7.73426 2.155 0.0311 * Model$Manage1
> -5.72100 2.79907 -2.044 0.0410 * Model$age
> -2.10245 0.84062 -2.501 0.0124 * Model$veg
> -0.62276 0.29968 -2.078 0.0377 * Model$wood1
> 0.36500 0.41976 0.870 0.3846 Model$under1
> 3.69383 2.73372 1.351 0.1766 Model$Manage1:Model$veg
> 0.20478 0.09007 2.274 0.0230 * Model$age:Model$veg
> 0.08319 0.03326 2.502 0.0124 * Model$wood1:Model$under1
> 1.02751 0.44610 2.303 0.0213 * Model$veg:Model$under1
> -0.17567 0.08846 -1.986 0.0470 * --- Signif. codes: 0 ‘***’
> 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Manage, wood and under are categorical with 2 levels each.
>
> My question is: how can I find the real value of the estimates in
> the summary output (since I used the contrast)? Also, how it works
> with the interactions estimate?
What do you mean by the "real value of the estimates"? I think you
might want to take a look at the lsmeans or effects packages, or you
could use predict() to compute the expected outcome for some
particular combination of factors ...
The question about contrasts/interpretation of parameters in linear
or generalized linear models is not really specific to mixed models.
Maybe take a look at Crawley's book, or Faraway's ...
> The books that I am reading don´t help much since they don´t show
> interactions between variables. Usually, they show only one
> variable with more levels. I Hope this is the right section to ask
> this question.
>
> Thank you for who can help to understand this (maybe simple)
> problem.
>
> Davide
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQEcBAEBAgAGBQJU/vVpAAoJEOCV5YRblxUHGMQH/3HMpXDO7Zouj4hBEPX9O9lm
1x6czZa+SQSCphKT01WevbT0wjLgFwaBhwfE/cFKbqr6YLsD5TsC3iG6FK5qzmob
Mmm1nWl1L04ZI7lPVkfH07UTDUNyQlToagPFuZYs/g+HlOx7vlQ44VgWIgTnGA3X
bmEtorIDF2n6PZvnMothJZrrri+0dOQBrFFDpdACpCR0zsGFQ4oJP5VJsW3mE40M
pqolU3CRMxO5Q9GzPO2I+P+IMb0rIj6Ke1ADdnkx1rt0QZcnndhFyA4wHk/rJwoQ
2NBXSgy+dBsX479CgCoS4aIJBTevUoHZ/S9SAAapoq8XAruEVwxPpYGxYqC1fMk=
=lwqn
-----END PGP SIGNATURE-----
More information about the R-sig-mixed-models
mailing list