[R-sig-ME] mixed model negative bionomial
Ben Bolker
bbolker at gmail.com
Thu Mar 28 02:58:25 CET 2013
Andrew McFadden (Andy <Andrew.McFadden at ...> writes:
>
> Hi all
> Really appreciate a hand here. I am trying to model some data with a
> bionomial outcome. I believe that I need to use a negative bionomial
> distribution as there were a lot of samples where a large number of
> zeros were present i.e. none sick and when modelled using a
> bionomial distribution in the lme4 package the residuals were
> extremely high. Hence the attempted use of gamlss package.
I can't help with gamlss at the moment, but: the negative binomial
is *not* an appropriate generalization of the binomial (unless you
have low probabilities everywhere and want to approximate the binomial
by a Poisson, in which case you would then get a NB). Beta-binomial
is to binomial and NB is to Poisson. You can model overdispersion
(which is *one* route to many zeros -- another is simply very low
overall prevalence, and a third is zero-inflation) in various ways:
see http://glmm.wikidot.com/faq ...
> I have had difficulty coding the model for the gamlss package,
> perhaps I have done something wrong. Also I would like to include
> the denominator in the outcome as the sample size varied per group
> i.e. in the lme4 package I coded it as:
> glmer(cbind(dat$NSick,dat$Ntest); but couldn't seem to do this in
> gamlss.
> The data below is "made up data", but reflects the analysis I am
> doing i.e. data clustered within farm (hence the need for a random
> effect), Lots of zero outcome (and the need to use a negative
> bionomial equation).
Overdispersion can be modeled in various packages; glmmADMB handles
zero-inflation (although it's not well tested for binomial models,
so check your results especially carefully).
Ben Bolker
More information about the R-sig-mixed-models
mailing list