[R] gam negative.binomial

From: Markus Loecher <mao.loecher_at_gmail.com>
Date: Fri, 16 May 2008 16:17:21 -0400

Dear list members,
while I appreciate the possibility to deal with overdispersion for count data either by specifying the family argument to be quasipoisson() or negative.binomial(), it estimates just one overdispersion parameter for the entire data set.
In my applications I often would like the estimate for overdispersion to depend on the covariates in the same manner as the mean.

For example,
#either library(mgcv) or library(gam):

 x <- seq(0,1,length = 100)*2*pi
 mu <- 4+ 2*sin(x)
 size <- 4 + 2*cos(x)
data <- cbind.data.frame(x<- rep(x,10), y = rnbinom(10*100,mu=rep(mu,10),size=rep(size,10)))

x.gam <- gam(y~s(x), data=data,family=quasipoisson()) plot(x.gam)

How would I get a smooth estimate of the overdispersion ?



        [[alternative HTML version deleted]]

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 Fri 16 May 2008 - 20:32:08 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 Sat 17 May 2008 - 18:30:38 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