Skip to content
Prev 318468 / 398506 Next

Negative Binomial Regression - glm.nb

Martin Spindler <Martin.Spindler <at> gmx.de> writes:
As Brian Ripley says, that's outside the scope of glm.nb(),
and a later chapter in MASS tells you how to do it.

  The mle2 function in the bbmle package offers a possibly
convenient shortcut.  Something like

  mle2(response~dnbinom(mu=exp(logmu),size=exp(logtheta)),
     parameters=list(logmu~[formula for linear predictor of log(mu)],
                     logtheta~[formula for linear predictor of log(beta)]),
     start=list(logmu=[starting value for logmu intercept],
                logbeta=[starting value for logbeta intercept]),
     data=...)

should work ...

 Ben Bolker