[R] Generelized Negative Binomial model in R
Ben Bolker
bbolker at gmail.com
Wed Oct 12 22:19:27 CEST 2011
Steve Lianoglou <mailinglist.honeypot <at> gmail.com> writes:
>
> Hi,
>
> On Wed, Oct 12, 2011 at 11:23 AM, Akram Khaleghei Ghosheh balagh
> <a.khaleghei <at> gmail.com> wrote:
> > Hello;
> >
> > Does anybody knows that R have a function for Generelized Negative Binomial
> > model, something like "gnbreg" in "STATA" where dispersion parameter itself
> > is a function of covaraites ?
>
> Take a look at the edgeR (and DESeq) package in bioconductor.
>
> edgeR uses a GLMs w/ negative binomial to assess differential
> expression of genomic regions using count data (aka next generation
> sequencing data).
>
> http://www.bioconductor.org/packages/release/bioc/html/edgeR.html
> http://www.bioconductor.org/packages/release/bioc/html/DESeq.html
>
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]
More information about the R-help
mailing list