glmmTMB with beta family

7.1k Views Asked by At

I am trying to model the photosynthetic response (fvfm) that takes values from 0 to 0.7, I am using the beta distribution since I have zero inflation, and I consider a dispersion model because my values move away from the average as they pass days, but when running this model:

beta7<-glmmTMB(fvfm~Temperature*dia+(1|ID), zi=~1, disp=~dia, data=ds, family=beta_family(link="logit"))

and this appears :

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

I add to all the values of my response variable 0.001, so I no longer have zero inflation and the model works. This is correct?? or is there any way to run without adding 0.001?? Thank you!! Regards Fran

1

There are 1 best solutions below

1
Daniel On

I think zero-inflated beta might work if your outcome includes 0 - the latest glmmTMB version on CRAN (1.0.0) is able to fit zero-inflated beta-regression.

Else, you might also think about "compressing" your response variable, using the normalize()-function and setting the include_bounds to FALSE.