Dear Nicolas,
Those models are different, hence you get different results. Note that two
levels are not enough to get stable variance estimates for the random
effect. See glmm wiki FAQ.
Op 11-jun.-2015 18:39 schreef "Nicolas Deguines" <nicodeguines at gmail.com>:
Dear lme4 authors & users,
I?m a postdoctoral research scholar working on the effect of
precipitation on the food web of a grassland semi-arid ecosystem in
California.
I am analyzing my dataset with version 1.1-7 of the lme4 package with
version 3.2.0 of R.
I encountered an issue while running a glmer model that includes
random effects from a categorical variable (?year?, 2010 and 2011) on
the slope of four explanatory variables.
Precisely, the estimated slope coefficients for 1 out of 4 explanatory
variables are identical in the two years. However, when running a
model including only this particular explanatory variable and the same
random effect from year on slope, estimates are different for the two
years (indeed, I did check that values are different in the two years.
It also happens for other models I?m running, e.g. with that
particular explanatory variable + two new ones: this time though, the
slope coefficients are different for that particular variable but
identical for the two new ones (nb: the response variable in this
model differs from the 1st model discussed).
Is this an issue that already occurred to other lme4 users? Any idea
about what I may be doing wrong?
I suspect it may come from the syntax of my models. I had fitted my model
as:
glmer(response ~ x1 + x2 + x3 + x4 +(x1|year) +(x2|year) +(x3|year)
+(x4|year), ? )
But I tried the following model:
glmer(response ~ x1 + x2 + x3 + x4 +(x1 + x2 +x3 +x4 | year), ? )
it does estimate different slope coefficients for each year.
I don?t know what meanings are associated with these two different
syntaxes though, and I would really appreciate any information or
reference anyone can give to clarify this.
I would be glad to provide additional information that may be needed
about the models or the dataset.
I take the opportunity while writing this email to thank lme4 authors
for developing and improving the very useful package that is lme4!
Best regards,
Nicolas Deguines