[R-sig-ME] Bernoulli glmm question.

Marko Bachl marko.bachl at uni-hohenheim.de
Thu Mar 13 08:34:37 CET 2014


Dear Rolf,
just a short technical reply to your question at the end - if a part
of your question is how to technically extract the random effect
variances from a lmer() fit.

> One thing that I am nervous about:
>
> If I fit the "trivial model"
>
> fit0 <- lmer(y ~ 1 + (1 | student), family = binomial, data = X)
>
> the resulting coefficients are just the estimates (BLUPs?) of the "random
> intercepts, is it not so?  If I calculate the variance of these
> coefficients:
>
>         var(coef(fit0)$student[,1])

The syntax to get the estimates of the random intercept variances from
a lmer() fit is

sapply(VarCorr(fit0), diag)

which should give you exactly the estimates from summary(fit0). There
has been some discussion on the list on why var(coef()) does not work,
but I cannot recall the answer or find the relevant thread.

Overall, your analytical approach seems to make sense to me - but I am
by no means an expert. I was wondering whether a second random effect
of "word" should (has to be?) included, if all students are tested
with the same words. Such a model would account for the assumption
that there are other characteristics of the words beyond the list of
your "phonemes" which have an effect on correct pronunciation. The
model would be

fit1  <- lmer(y ~ 1 + (1 | student) + (1 | word), family = binomial, data = X)

where "word" and "student" are crossed random effects, which would
perfectly balanced if every student was tested with every word. But
again: I am not exactly familiar with this kind of research, so I am
just guessing...

Best regards
Marko

-- 
www.komm.uni-hohenheim.de/bachl



More information about the R-sig-mixed-models mailing list