I think the `gamlss' package can do this.
Simon
On Fri, 16 May 2008, Markus Loecher wrote:
> 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)
> summary(x.gam)
>
> How would I get a smooth estimate of the overdispersion ?
>
> Thanks,
>
> Markus
>
> [[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.
>