Andy--
Also, check your glmer() formula.  I believe that for family=binomial, the
response is specified as cbind(success,failure) and not
cbind(success,trials) as in SAS.  Your example code
glmer(cbind(dat$NSick,dat$Ntest)) might need to be cbind(NSick,NWell) or
cbind(NSick,Ntest-NSick).  I don't suggest that this will eliminate all of
your overdispersion, but if your Ntest is really the number of individuals
at risk in each group, your coding will inflate the number of
non-responses.

Tom


On Wed, Mar 27, 2013 at 6:58 PM, Ben Bolker <bbolker@gmail.com> wrote:

> Andrew McFadden (Andy <Andrew.McFadden@...> 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
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



-- 
-------------------------------------------
Tom Philippi, Ph.D.
Quantitative Ecologist & Data Therapist
Inventory and Monitoring Program
National Park Service
(619) 523-4576
Tom_Philippi@nps.gov
http://science.nature.nps.gov/im/monitor

	[[alternative HTML version deleted]]

