Skip to content
Prev 347695 / 398500 Next

Regression Overdispersion?

A third, and often preferable, way is to add an observation-level random effect:

library(lme4)
data1$obs <- factor(seq_len(nrow(data1)))
model <- glmer(y ~ x1 + x2 + (1 | obs), family=poisson(link=log), data=data1)

See http://glmm.wikidot.com/faq and search for "individual-level
random effects".

Cheers,
Rune
On 1 February 2015 at 19:55, David Barron <dnbarron at gmail.com> wrote: