Hello all, I have count data with about 36% of observations being zeros. I found in some of the examples of the r-help mail archives that a tweedie family of distributions could be used to fit a model with random effects. Upon installing the tweedie package and attempting to fit the following model: lmer(SUS ~ 1 + (1| GRP),REML=FALSE,data=mydata,family=tweedie(var.power=1.55,link.power=0)) I get the following error: Error in famType(glmFit$family) : unknown GLM family: ?Tweedie? If it helps, im on a mac with R V 2.9.1, lme4 V.0.999375-31, Tweedie V2.0. Thanks, Mohammad AlMarzouq
Mohammad AlMarzouq <koutbo6 <at> gmail.com> writes:> > Hello all, > > I have count data with about 36% of observations being zeros. I found > in some of the examples of the r-help mail archives that a tweedie > family of distributions could be used to fit a model with random > effects. Upon installing the tweedie package and attempting to fit the > following model: > > lmer(SUS ~ 1 + (1| > GRP),REML=FALSE,data=mydata,family=tweedie(var.power=1.55,link.power=0)) > > I get the following error: > > Error in famType(glmFit$family) : unknown GLM family: ?Tweedie? > > If it helps, im on a mac with R V 2.9.1, lme4 V.0.999375-31, Tweedie > V2.0. >I'm surprised that you found evidence that tweedie could be used with lmer: in general, lmer only allows families that have been hard-coded (and doesn't allow families with "extra" parameters, such as negative binomial, beta-binomial, tweedie etc.). Perhaps you were reading about lme? Ben Bolker
This is the link that gave me the indication: https://stat.ethz.ch/pipermail/r-help/2007-March/127261.html Are there alternative ways to deal with a high count of zeros for count data with lmer?
If you don't have too many groups then you could get mgcv:gam to fit this using the Tweedie family from mgcv. It's a bit fiddly, but there's an example at the end of ?gam.models with exactly your RE structure. On Wednesday 26 August 2009 17:30, Mohammad AlMarzouq wrote:> Hello all, > > I have count data with about 36% of observations being zeros. I found > in some of the examples of the r-help mail archives that a tweedie > family of distributions could be used to fit a model with random > effects. Upon installing the tweedie package and attempting to fit the > following model: > > lmer(SUS ~ 1 + (1| > GRP),REML=FALSE,data=mydata,family=tweedie(var.power=1.55,link.power=0)) > > I get the following error: > > Error in famType(glmFit$family) : unknown GLM family: ?Tweedie? > > If it helps, im on a mac with R V 2.9.1, lme4 V.0.999375-31, Tweedie > V2.0. > > Thanks, > > Mohammad AlMarzouq > > ______________________________________________ > 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.--> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK > +44 1225 386603 www.maths.bath.ac.uk/~sw283