[R-sig-ME] GLMM with Poisson
Ben Bolker
bbolker at gmail.com
Sat Nov 19 02:04:39 CET 2011
Zofia Ecaterina Taranu <zofia.taranu at ...> writes:
> I have a question for conducting a GLMM with the Poisson
> distribution. I ran the following command:
> Mglmm1<-lmer(Richness ~ 1 + NAP + fExp + (1 | fBeach),
> family=poisson(link="log"),data=RIKZ)
> summary(Mglmm1)
I prefer glmer() to make it explicit that this is a GLMM
(but it doesn't really matter at present).
>
> However, in the summary output does not provide the
> null and residual deviances to determine wether
> overdispersion has occurred. How can I calculate
> these values given the model output below?
The residual deviance is given in the first summary line
(with AIC, BIC, logLik).
You could get a null deviance by fitting whatever
you consider to be the null model (it might be ~1, or
it might ~1 + (1|fBeach): you decide).
You can get the Pearson chi-squared goodness-of-fit
statistic as
sum(residuals(Mglmm1)^2)
(lme4 gives Pearson residuals for GLMMs by default.)
It's also a bit tricky to decide what the residual df
are (how do you count random effects?), but we could
say that this model has 4 parameters (intercept,
NAP, fExp11, among-fBeach variance) and hence 41 residual
df, so deviance/residual df is *approximately* 1.5 -- may
be worth trying an observation-level random effect to
see what happens (or just inflating the standard errors of
the estimates by sqrt(1.5)).
> Generalized linear mixed model fit by the Laplace approximation
> Formula: Richness ~ 1 + NAP + fExp + (1 | fBeach)
> Data: RIKZ
> AIC BIC logLik deviance
> 71.56 78.78 -31.78 63.56
> Random effects:
> Groups Name Variance Std.Dev.
> fBeach (Intercept) 0.060445 0.24586
> Number of obs: 45, groups: fBeach, 9
>
> Fixed effects:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) 2.04181 0.13302 15.350 < 2e-16 ***
> NAP -0.50383 0.07421 -6.789 1.13e-11 ***
> fExp11 -0.86703 0.22353 -3.879 0.000105 ***
> ---
More information about the R-sig-mixed-models
mailing list