Skip to content
Prev 274243 / 398506 Next

Generelized Negative Binomial model in R

Steve Lianoglou <mailinglist.honeypot <at> gmail.com> writes:
You could code it fairly easily in mle2, e.g.

mle2(y~dnbinom(exp(logmu),exp(logk)),
       data=..., start=...,
       parameters=list(logmu~...,logk~...)

where the ... within parameters specify linear models for the log-mean
and log-overdispersion parameters.
  You do have to specify your own starting conditions, and it doesn't
do anything clever in terms of special-purpose optimization -- it just
uses the optimizers built into optim() [with a few other choices, e.g.
those from the optimx package]