Hi -I'm running a GAM with 7 explanatory variables with a Poisson error structure. All of the variables are continuous so I'm getting error messages in R. cod.fall.full.gam.model<-gam(Kept.CPUE~s(HOUR)+s(LAT_dec)+s(LONG_dec)+s(meantemp_C)+s(meandepth_fa)+s(change_depth)+s(seds), data=cod.fall.version2,family=poisson) In dpois(y, mu, log = TRUE) ... : non-integer x = 5.325517 Thanks Sally -- View this message in context: http://www.nabble.com/GAM-and-Poisson-distribution-tp20508604p20508604.html Sent from the R help mailing list archive at Nabble.com.
sallyr wrote:> > Hi -I'm running a GAM with 7 explanatory variables with a Poisson error > structure. All of the variables are continuous so I'm getting error > messages in R. > > cod.fall.full.gam.model<-gam(Kept.CPUE~s(HOUR)+s(LAT_dec)+s(LONG_dec)+s(meantemp_C)+s(meandepth_fa)+s(change_depth)+s(seds), > data=cod.fall.version2,family=poisson) > > In dpois(y, mu, log = TRUE) ... : non-integer x = 5.325517 > > Thanks Sally >If your response variable is an intensity (catch per unit effort) you probably need to include an offset for the total effort, e.g. something like offset=log(effort) -- View this message in context: http://www.nabble.com/GAM-and-Poisson-distribution-tp20508604p20513810.html Sent from the R help mailing list archive at Nabble.com.
Sally, Is Kept.CPUE discrete valued? If it isn't then the poisson family won't like it, and it would be better to use quasipoisson, if the variance proportional to mean is the right assumption. (mgcv 1.5 includes a Tweedie family, which would be an alternative, but it's not ready for release yet). best, Simon On Friday 14 November 2008 21:29, sallyr wrote:> Hi -I'm running a GAM with 7 explanatory variables with a Poisson error > structure. All of the variables are continuous so I'm getting error > messages in R. > > cod.fall.full.gam.model<-gam(Kept.CPUE~s(HOUR)+s(LAT_dec)+s(LONG_dec)+s(mea >ntemp_C)+s(meandepth_fa)+s(change_depth)+s(seds), > data=cod.fall.version2,family=poisson) > > In dpois(y, mu, log = TRUE) ... : non-integer x = 5.325517 > > Thanks Sally--> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK > +44 1225 386603 www.maths.bath.ac.uk/~sw283