Dear list,

- is it possible to fit a mixed model using a negative binomial  
distribution of the error with lmer (lme4)?

In the help page of lmer it is clearly stated that "family = a GLM  
family, see glm and family", which does not include negative binomial.

However, searching in the archives of R-help mail lists I've found  
some contradictory information:

(1) some people claim to be using lmer with family =  
negative.binomial(theta) and they even show some results for their  
models. E.g.
http://tolstoy.newcastle.edu.au/R/help/06/07/31766.html
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2007q4/000468.html

(2) In one thread Bill Venables says: "lmer will work with negative  
binomial models, provided you specify an explicit, scalar value for  
theta. Rather than family = negative.binomial(theta = x) try something  
like family=negative.binomial(theta = 2.5) (or whatever you wish  
specify as theta)."
https://stat.ethz.ch/pipermail/r-help/2007-November/145869.html

(3) In Aug 2008 D. Bates says: "the negative binomial family is not  
defined as a glm family.  The glm.nb function is a special-purpose  
function for fitting that model.  I'm not really sure what  
modifications would be needed to glmer to be able to fit such a model  
but I fear that they would not be trivial"
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q3/001262.html

When I try to fit my models or the models shown in (1) I obtain the  
following error message "Error in famType(glmFit$family):   unknown  
GLM family: 'Negative Binomial(0.5523)'", which is in agreement with  
the information in lmer help page.

If it is not possible to use negative.binomial with lmer, how did some  
people manage to fit such models, was it an old version of the function?

##########################
# replicable self-contained example

nsubj <- 10; ntimes <- 100
mydf<-data.frame(subjs=seq(1:nsubj),
counts=rnbinom(nsubj*ntimes, size=0.5, mu=1.8))

require(MASS); require(lme4)
fixed.nb0 <- glm.nb(counts~1, data=mydf)
lmer(counts~1+(1|subjs), family = negative.binomial  
(theta=fixed.nb0$theta), data=mydf)
##########################

I'm running R version 2.8.0 and lme4 version 0.999375-27 on a Mac

Thank you very much for any help.

Best,

Ahimsa Campos Arceiz
PhD candidate
Lab of Biodiversity Science
The University of Tokyo

It's tough to make predictions, especially about the future - Yogi Berra




	[[alternative HTML version deleted]]


