I fitted a GAM model with Poisson distribution to a data with about 200 observations. I noticed that the plot of the residuals versus fitted values show a trend. Residuals tend to be lower for higher fitted values. Because, I'm dealing with count data, I'm thinking that this might be due to overdispersion. Is there a way to account for overdispersion in any of the packages MGCV or GAM? I welcome any suggestions that one may have on this topic. Jean
Jean, The standard treatment of overdispersed data when using the Poisson distribution to model count data is to switch to the negative binomial distribution. Hope this helps, Tim Liao ---- Original message ---->Date: Thu, 13 Jan 2005 18:22:29 -0500 >From: "Jean G. Orelien" <jorelien at scimetrika.com> >Subject: [R] GAM: Remedial measures >To: <r-help at stat.math.ethz.ch> > >I fitted a GAM model with Poisson distribution to a data withabout 200>observations. I noticed that the plot of the residualsversus fitted values>show a trend. Residuals tend to be lower for higher fittedvalues. Because,>I'm dealing with count data, I'm thinking that this might bedue to>overdispersion. Is there a way to account for overdispersionin any of the>packages MGCV or GAM? > > > >I welcome any suggestions that one may have on this topic. > > > >Jean > > > >________________ >______________________________________________ >R-help at stat.math.ethz.ch mailing list >stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide!R-project.org/posting-guide.html
> I fitted a GAM model with Poisson distribution to a data with about 200 > observations. I noticed that the plot of the residuals versus fitted values > show a trend. Residuals tend to be lower for higher fitted values. Because, > I'm dealing with count data, I'm thinking that this might be due to > overdispersion. Is there a way to account for overdispersion in any of the > packages MGCV or GAM?You can `allow for' overdispersion in mgcv::gam by using the quasipoisson family, or setting scale to -1 in the gam call. In a straight GLM this would make no difference to the residual plots, since the scale parameter does not change the coefficient estimates. However, things are different for a GAM with automatic smoothness estimations, since the scale parameter does influence the smoothing parameter estimation criterion. Another possibility is to use the negative binomial family from the MASS library, and a third is to use the quasi family. Simon _____________________________________________________________________> Simon Wood simon at stats.gla.ac.uk stats.gla.ac.uk/~simon >> Department of Statistics, University of Glasgow, Glasgow, G12 8QQ >>> Direct telephone: (0)141 330 4530 Fax: (0)141 330 4814