[R-sig-ME] zero-inflation beta or gamma model?

Luca Santini |uc@@@@nt|n|@eco @end|ng |rom gm@||@com
Thu Jan 9 11:28:32 CET 2020


I have a response variable expressed as proportion that varies from 0 to 1. The variable is highly left skewed, and about half of the values are zeros. I found a previous question related to a possible use of beta family together with a zero-inflation, to which B. Bolker replied it was possible using a hurdle approach in the glmmTMB package. I rescaled the response to 0 - 0.999 (only 1 value is = 1) and tried this approach.

However, when I run 

mod<-glmmTMB(TerrBeta2 ~ 1 + (1|Family/Genus/Species) + (1|Site/Year/Month), family=beta_family(), ziformula=~., data=data2)

I get the following error message (looks like the ziformula argument is ignored)

Error in eval(family$initialize) : y values must be 0 < y < 1

I also tried to specify the family differently

mod<-glmmTMB(TerrBeta2 ~ 1 + (1|Family/Genus/Species) + (1|Site/Year/Month), family=list(family="beta",link="logit"), ziformula=~., data=data2)

But I get this

Error in nlminb(start = par, objective = fn, gradient = gr, control = control$optCtrl) : 
  gradient function must return a numeric vector of length 15
In addition: Warning messages:
1: In glmmTMB(TerrBeta2 ~ 1 + (1 | Family/Genus/Species) + (1 | Site/Year/Month),  :
  some components missing from ‘family’: downstream methods may fail
2: In mkTMBStruc(formula, ziformula, dispformula, combForm, mf, fr,  :
  specifying ‘family’ as a plain list is deprecated
3: In nlminb(start = par, objective = fn, gradient = gr, control = control$optCtrl) :
  NA/NaN function evaluation
Timing stopped at: 0.626 0.065 0.689

Any suggestion? 

Another option to avoid rescaling the variable may be using the gamma family, but I get into the same error messages. 
Any suggestion would be greatly appreciated!


	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list