[R] glm.nb versus glm estimation of theta.
hesicaia
dboyce at dal.ca
Thu Aug 13 20:31:38 CEST 2009
Hello,
I have a question regarding estimation of the dispersion parameter (theta)
for generalized linear models with the negative binomial error structure. As
I understand, there are two main methods to fit glm's using the nb error
structure in R: glm.nb() or glm() with the negative.binomial(theta) family.
Both functions are implemented through the MASS library. Fitting the model
using these two functions to the same data produces much different results
for me in terms of estimated theta and the coefficients, and I am not sure
why.
the following model:
mod<-glm.nb(count ~ year + season + time + depth,
link="log",data=dat,control=glm.control(maxit=100,trace=T))
estimates theta as 0.0109
while the following model:
mod2<-glm(count ~ year + season + time + depth,
family=negative.binomial(theta=100),link="log",data=dat,control=glm.control(maxit=100,trace=T))
will not accept 0.0109 as theta and instead estimates it as 1271 (these are
fisheries catch data and so are very overdispersed).
Fitting a quasipoisson model also yields a large dispersion parameter
(1300). The models also produce different coefficients and P-values, which
is disconcerting.
What am I doing wrong here? I've read through the help sections
(?negative.binomial,?glm.nb, and ?glm) but did not find any answers.
Any help and/or input is greatly appreciated!
Daniel.
--
View this message in context: http://www.nabble.com/glm.nb-versus-glm-estimation-of-theta.-tp24956438p24956438.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list