# [R-sig-ME] modelling saturated random effects with glmm

jos matejus matejus106 at googlemail.com
Mon Jul 27 16:19:14 CEST 2009

```Dear all,

I was wondering whether anyone could enlighten me on the following.

Why is it I can fit a generalized linear mixed model (family = poisson
for example) with lmer where I have as many levels of my random effect
as data points whereas with a linear mixed effects model (gaussian
distributed errors) I get an error message. I understand that the
random effect variance is completely confounded with the residual
variance in the case of a linear mixed model, but why is this not so
with a generalized linear mixed model?

for example

data(ergoStool, package="nlme") # load data
ergoStool\$rantest <- 1:36 #create a pseudo random effect to illustrate

library(lme4)

stool.lmm <- lmer(effort~Type+(1|rantest),  data=ergoStool)
#Error: length(levels(dm\$flist[])) < length(Y) is not TRUE

stool.glmm <- lmer(effort~Type+(1|rantest) , family=poisson,  data=ergoStool)

summary(stool.glmm)

Generalized linear mixed model fit by the Laplace approximation
#Formula: effort ~ Type + (1 | rantest)
Data: ergoStool
AIC   BIC logLik deviance
19.47 27.39 -4.737    9.474
Random effects:
Groups  Name        Variance Std.Dev.
rantest (Intercept)  0        0
Number of obs: 36, groups: rantest, 36

Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept)  2.14658    0.11396  18.836   <2e-16 ***
TypeT2       0.37469    0.14804   2.531   0.0114 *
TypeT3       0.23091    0.15263   1.513   0.1303
TypeT4       0.07503    0.15823   0.474   0.6354
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
(Intr) TypeT2 TypeT3
TypeT2 -0.770
TypeT3 -0.747  0.575
TypeT4 -0.720  0.554  0.538

Many thanks in advance
Jos

```