On Mon, 3 May 2010, Tim Clark wrote:

Dear List,

I am trying to do model averaging for a negative binomial model using the package AICcmodavg. I need to use glm() since the package does not accept glm.nb() models. I can get glm() to work if I first run glm.nb and take theta from that model, but is there a simpler way to estimate theta for the glm model? The two models are:

mod.nb<-glm.nb(mantas~site,data=mydata)
mod.glm<-glm(mantas~site,data=mydata, family=negative.binomial(mod.nb$theta))

How else can I get theta for the family=negative.binomial(theta=???)

library(MASS) is missing here -- do give credit where credit is due.
It contains functions

glm.convert
theta.ml

and the first does what you seem to want and the second answers the actual question you asked.

Thanks!

Tim

Tim Clark
Department of Zoology
University of Hawaii

--
Brian D. Ripley,                  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@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.

Reply via email to