I am planning to perform a zero-inflated negative binomial regression for colony forming units (CFUs) of bacteria with a drug treatment, accounting for variability in the intercept among experiments. I decided said approach, since there are some drugs in which I obtain a fair ammount of zeros. For that, I plan to use the glmmTMB
package.
I was just wondering that, in order to model both the zero-inflated and the counts components of the model with the random effect, should I add the random effect on both formulas? e.g.
glmmTMB(CFU~Treatment+(1|Experiment),ziformula=~Treatment+(1|Experiment), family=nbinom2)
Thank you in advance.
glmmTMB
handles random effects in theziformula
. If it does, and you as the scientist think there's an appropriate theoretical justification for putting a random effect in theziformula
, then try it! Just keep in mind that it can be difficult to estimate multiple sets of random effects, and it may be difficult to actually get the model to fit when it's complex esp. if you have a small dataset. Keep an eye out for shenanigans and sense in the model results. $\endgroup$ziformula
can take a random effect here (hint: it does, and it's right there in the documentation ...) $\endgroup$Experiment
variable? $\endgroup$