Hi; I am running generalized linear mixed models (GLMMs) with the lmer function from the lme4 package in R 2.6.2. My response variable is overdispersed, and I would like (if possible) to run a negative binomial GLMM with lmer if possible. I saw a posting from November 15, 2007 which indicated that there was a way to get lmer to work with negative binomial by assigning: family negative.binomial(theta=2.5) (or whatever value I would like to specify for theta). However I have not been able to get lmer to work while attempting to specify the family as negative.binomial. I get an error message that says "could not find fuction "negative.binomial". Is there a way to make lmer run negative binomial GLMMs with lmer in the current version of R? Thanks so much! Marty [[alternative HTML version deleted]]
Perhaps because you have not loaded the package that contains it? If you have installed MASS (via the super package VR) then try: require(MASS) ?negative.binomial -- David Winsemius On Dec 11, 2008, at 4:29 PM, Marty Kardos wrote:> Hi; > > I am running generalized linear mixed models (GLMMs) with the lmer > function > from the lme4 package in R 2.6.2. My response variable is > overdispersed, and > I would like (if possible) to run a negative binomial GLMM with lmer > if > possible. I saw a posting from November 15, 2007 which indicated > that there > was a way to get lmer to work with negative binomial by assigning: > family > negative.binomial(theta=2.5) (or whatever value I would like to > specify for > theta). However I have not been able to get lmer to work while > attempting > to specify the family as negative.binomial. I get an error message > that > says "could not find fuction "negative.binomial". > > Is there a way to make lmer run negative binomial GLMMs with lmer in > the > current version of R? > > Thanks so much! > > Marty > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.
Marty Kardos wrote:> > Hi; > > I am running generalized linear mixed models (GLMMs) with the lmer > function > from the lme4 package in R 2.6.2. My response variable is overdispersed, > and > I would like (if possible) to run a negative binomial GLMM with lmer if > possible. I saw a posting from November 15, 2007 which indicated that > there > was a way to get lmer to work with negative binomial by assigning: family > > negative.binomial(theta=2.5) (or whatever value I would like to specify > for > theta). However I have not been able to get lmer to work while attempting > to specify the family as negative.binomial. I get an error message that > says "could not find fuction "negative.binomial". > > Is there a way to make lmer run negative binomial GLMMs with lmer in the > current version of R? > > Thanks so much! > > Marty >Alas, this is simply not possible in the current version of lmer, and is not completely trivial to fix (i.e., you won't be able to hack a couple of lines in the R code and make it work). If you really need a negative binomial GLMM then the glmmADMB package is probably your best bet. There's an active thread on the topic of overdispersion and GLMMs (now diverging to more general philosophy of statistics) running on the r-sig-mixed-models mailing list; I'd suggest you send follow-up questions to that forum. cheers Ben Bolker -- View this message in context: http://www.nabble.com/negative-binomial-lmer-tp20966631p20992317.html Sent from the R help mailing list archive at Nabble.com.