[R] GAM: Remedial measures
Simon Wood
simon at stats.gla.ac.uk
Fri Jan 14 11:16:05 CET 2005
> 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 www.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
More information about the R-help
mailing list