# [R] poisson with overdispersion

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu May 1 14:38:15 CEST 2003

```That's an answer about S-PLUS rather than R.  S-PLUS does not have a
quasipoisson family, and treats its poisson family in an inconsistent way
(sometimes as quasi-Poisson and sometimes not).

For R, use the quasipoisson family or the negative binomial family via
glm.nb.  See section 7.5 of MASS (the book, fourth edition) for fuller
details.

On Thu, 1 May 2003, Martin Hoyle wrote:

> Dear Amanda,
> According to "Statistical Computing" by Crawley, p545, you
> can deal with overdispersion by any one of 3 ways;
>
> 1: Carry out significance tests using "F" rather than "Chi" in the anova
> function for comparison of deviances,
> 2: Use quasipoisson, and specify a variance function, or,
> 3: Use negative binomial error (see library(MASS), glm.nb).
>
> To answer the second part of your qu, if you do summary(model), you will
> get the estimate and s.e. of the log transform of your response variable
> (log is the default link).

The model is for the log of the means, not the log of the variable.

You get the fitted values via fitted(fit).  For associated se's you need to
use predict(fit): if you use a quasipoisson model you will automatically
get over-dispersion taken into account.

> >>> Amanda Phipps <genepi51 at yahoo.com> 05/01/03 06:04am >>>
> I am fitting a poisson model and it appears to have
> overdispersion.  I am interested in using the
> quasipoisson family (with the glm command).  Will this
> account for the overdispersion in the model?  Is there
> an additional method for accounting for a dispersion
> parameter not equal to 1 (with the glm command)?
>
> And after fitting the model, how to I obtain the
> fitted values and their respective standard errors?

--
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

```