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

Greg Snow Greg.Snow at imail.org
Mon Jul 27 17:46:37 CEST 2009


This is a basic property of the distributions.

The normal distribution has 2 parameters, the mean and the variance which are independent of each other.  Therefore in any type of model based on the normal distribution you need at least 1 degree of freedom left over after estimating the mean in order to estimate the variance.

The poisson distribution only has 1 parameter because the variance is equal to the mean in the poisson, so you can use all the degrees of freedom estimating the mean, and that gives you the variance, you don't need additional information to estimate it.  

All this of course is dependent on your assumptions about the distributions being reasonable (the routines do what you tell them too whether they make sense or not).  And any model that uses all or even the majority of the degrees of freedom is unlikely to be very precise or informative even if you do get an "answer".

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-
> models-bounces at r-project.org] On Behalf Of jos matejus
> Sent: Monday, July 27, 2009 8:19 AM
> To: r-sig-mixed-models at r-project.org
> Subject: [R-sig-ME] modelling saturated random effects with glmm
> 
> 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[[1]])) < 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
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models




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