Re: [R] estimate of overdispersion with glm.nb

From: Ben Bolker <bolker_at_ufl.edu>
Date: Tue, 22 Apr 2008 21:49:39 +0000 (UTC)

Markus Loecher <mao.loecher <at> gmail.com> writes:

>
> Dear R users,
> I am trying to fully understand the difference between estimating
> overdispersion with glm.nb() from MASS compared to glm(..., family =
> quasipoisson).
> It seems that (i) the coefficient estimates are different and also (ii) the
> summary() method for glm.nb suggests that overdispersion is taken to be one:
> "Dispersion parameter for Negative Binomial(0.9695) family taken to be 1",
> which is not what I expected.

  Quasi-Poisson and negative binomial models serve approximately the same purpose (i.e. account for overdispersion in count data), but they are both conceptually and technically different. QP simply assumes a variance-mean relationship (var=phi*mean), while NB assumes an explicit likelihood model -- in addition, NB has a different var-mean relationship (var=mu*(1+mu/k)). When R tells you "dispersion parameter taken to be 1", I believe it means that in the expression var=phi*mu*(1+mu/theta), phi is 1 -- that is, there isn't an *additional* dispersion factor incorporated. (Fitting NB with a *known* overdispersion parameter theta is within the standard GLM framework, but estimating theta is an extension, so the terminology doesn't always fit nicely.)

  As plot(coef(tmp.glm.qp),coef(tmp.glm.nb)) would show you, the coefficients are different but not very different -- this is not terribly surprising considering that the two fits are using different statistical models.

> On a more advanced topic, I was furthermore hoping to compare models with a
> global estimate of overdispersion with one that allows overdispersion to be
> estimated separately for each level of the factor x. Can I achieve that in
> glm or do I need to employ a mixed effects model ?

   You can fit completely separate models for the different levels of x, but it's hard to (for example) fit a model with the same mean-effects parameters but different overdispersion. I don't think mixed-effect models will necessarily help you here. I was going to suggest bbmle (blatant plug!), but I haven't implemented offsets yet. The negbinomial family in the VGAM package might help you here ...



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Apr 2008 - 21:54:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Apr 2008 - 00:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive