Skip to content
Prev 1511 / 20628 Next

Poisson mixed models

On 21/10/2008, at 11:37 PM, Douglas Bates wrote:

            
I posted this before but it seems to have been missed.

A quick simulation shows that something is wrong. What I did was to  
generate random effects Poisson data and fit both as Poisson and quasi  
Poisson, and should give similar results except with slightly larger  
SE for quasi. Note the change in the subject random effect std dev.  
This seems to be close to the square of the mean of the Poisson data.  
Standard errors for fixed effects are totally wrong.

Ken

 > nsubj <- 100
 > npersubj <- 20
 >
 > subject <- factor(rep(1:nsubj,each=npersubj))
 >
 > means <- exp(rep(10+rnorm(nsubj),each=npersubj))
 >
 > y <- rpois(nsubj*npersubj,means)
 >
 > simdata <- data.frame(y,subject)
 >
 > lmer1 <- lmer(y~(1|subject),data=simdata,family=poisson)
 > summary(lmer1)
Generalized linear mixed model fit by the Laplace approximation
Formula: y ~ (1 | subject)
    Data: simdata
   AIC  BIC logLik deviance
  3305 3316  -1650     3301
Random effects:
  Groups  Name        Variance Std.Dev.
  subject (Intercept) 0.9891   0.99453
Number of obs: 2000, groups: subject, 100

Fixed effects:
             Estimate Std. Error z value Pr(>|z|)
(Intercept) 10.12714    0.09945   101.8   <2e-16 ***
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
 >
 > lmer2 <- lmer(y~(1|subject),data=simdata,family=quasipoisson)
 > summary(lmer2)
Generalized linear mixed model fit by the Laplace approximation
Formula: y ~ (1 | subject)
    Data: simdata
   AIC  BIC logLik deviance
  3307 3324  -1650     3301
Random effects:
  Groups   Name        Variance Std.Dev.
  subject  (Intercept) 15137    123.03
  Residual             15304    123.71
Number of obs: 2000, groups: subject, 100

Fixed effects:
             Estimate Std. Error t value
(Intercept)    10.13      12.30  0.8231