# [R-sig-ME] How to calculate the level-1 variance of a GLMM (Poisson or Additive Over-dispersed Poisson) model?

Ulf Köther ukoether at uke.de
Fri Oct 31 19:42:57 CET 2014

```Dear Graham,

to provide some hints regarding your problem (as I also asked something
like that some weeks ago), here is the mailing list thread where my

https://mailman.stat.ethz.ch/pipermail/r-sig-mixed-models/2014q3/022540.html

In general, you have to replace the "residual variance" of the binomial
distribution (pi^2/3) with that of the poisson distribution (ignoring
any overdispersion):

ln(1/ exp(β0) + 1)

where β0 is the intercept on the link scale. (If I am wrong here, could
someone correct me, please?). Regarding the use of an observation-level
random intercept, this procedure should work accordingly (with one

For the negative binomial, it seems a bit more tricky, and as a short
tip, I can only point you to this article:

http://www.springerplus.com/content/pdf/2193-1801-3-40.pdf

Because the variance of the negbin is not equal to the mean as in the
poisson, I would guess (I mean, really GUESS!!!), that β0 from above
should be replaced by something like

β0 + alpha * β0^2

where alpha = 1 / theta (which is the negbin-dispersion parameter as
given by glmer.nb or glm.nb for example, or glmmABMD, but I am not sure
for the latter...).

But bear in mind, that all this on the negbin is purely coming from a
non-statistician, and you should ask someone who acutally *knows* the

For the question on years: I do not know if there is a better
possibility than fitting several models (for each year of interest), but
you need enough data for this... using year as a random slope and
putting all data in one model to derive the icc will be more complicated
than fitting 3 or 4 models each without the random slope....I think...

Good luck.

Am 31.10.2014 um 11:27 schrieb Graham B. McNamara:
> Dear all,
>
> I'm estimating a three-level GLMM model of Students nested in Classes
> nested Schools: a random-intercept model with just one predictor
> variable (no random slopes). The dependent variable is a count
> variable, but has a much higher variance than its mean, indicating I
> probably need to be thinking of an overdispersed Poisson /
> Negative-binomial.
>
> I am interested in the proportion of variance found on each level:
> decomposing the total variance. In linear models, the variance of all
> random effects is presented int he summary() statement. But for GLMM
> models, this is not the case: only the Class and School level variance
> are reported. I understand the reason for this, and I have also read
> (and learned a lot from) the caveats on http://glmm.wikidot.com/faq.
>
> However, there are also papers describing several methods to retrieve
> the Level-1 (student) level variance anyway:
> http://www.bristol.ac.uk/cmm/software/support/support-faqs/pval.html/#macros
> deals with two-level binomial models and
> http://onlinelibrary.wiley.com/doi/10.1111/j.1467-985X.2004.00365.x/abstract
> deals with over-dispersed binomial models.
>
> Is there such a method available for Poisson, Over-dispersed Poisson,
> or Negative Binomial models? A piece of code, somewhere, perhaps?
>
>
> To explain my models:
>
>   # poisson
>   fit.glmer <- glmer(y ~ x1 + (1 | class) + (1 | school), data =
> mydata, verbose = TRUE, family = poisson)
>
> I also created an additive overdispered poisson-lognormal model by
> adding a per-observation (Student-level) random effect (as per Ben
> Bolker's code found on
> http://blogs.umass.edu/nrc697sa-finnj/2012/11/08/bolkers-reanalysis-of-owl-data/):
>
>   # poisson-lognormal
>   fit.glmer.1 <- glmer(y ~ x1 + (1 | class) + (1 | school) + (1 |
> over), data = mydata, verbose = TRUE, family = poisson)
>
> And fit.glmer.1 seems to have much better fit than fit.glmer.
>
>
> FYI, I'm *actually* interested in how the variance proportion across
> levels change over time. For example, in 2010 most of the outcome
> variance may be found on the Student-level: say 70% of the variance is
> found on the Student level, 20% on the Class level, and 10% on the
> School level. In 2011, with the same students, 50% of the variance is
> found on the Student level, 40% on the class level, and 10% on the
> School level. Thus, the between-student variance has decreased from
> 70% to 50% from 2010 to 2011. This is what I'm actually trying to
> figure out for my data.
> (At the moment I'm stuck with doing log-transformed lmer models per
> year, because that's the only way I know to get at least *some* idea
> about the level-1 variance... Any help is appreciated.)
>
> Thanks a bunch,
>
> Graham
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

--

--

DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN.
www.uke.de/125
_____________________________________________________________________

Besuchen Sie uns auf: www.uke.de
_____________________________________________________________________

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg
Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING
```