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] ______________________________________________ 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.