I am fitting a glmm for count data as follow:

glmmTMB(counts ~ treatmens + vegetation + days + (1 + treatments|sites), data = data, family = nbinom1, ziformula = ~1))

As far as I understand the glmmTMB manual this means that I think that the effect of treatments varies across sites, and that the zero-inflation is assumed to be constant across data. However, I would like to model it in a way that the zero-inflation will vary by sites. Now I am a bit confused on how to specify this in the model, something like:

ziformula = ~sites or ziformula = ~(1|sites).

It is a bit hard for me to grasp the differences


1 Answer 1


I think the answer here is not different from any other "should it be fixed or random" decision: are you explicitly interested in which sites have a significantly higher probability of absence, or do you simply want to account for the fact that the probability of absence may vary among them?

See also:

What is the difference between fixed effect, random effect and mixed effect models?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.