1

I am running a generalized linear mixed effect model using the glmmTMB package to analyse number of bite wounds in a wild predator.

my model:

Mod<-glmmTMB(all~Sex+class+sseason+timeR+class:timeR+(1|Microchip)+(1|olre), data = mydata_select, family = nbinom1, REML = FALSE, na.action = na.fail)

My data is overdispersed, thus I have added an observation level random effect. I would like to use the predict function to predict number of bite wounds based on the model. I know that for a glmer model I can use the re.form=~(1|Microchip) to ensure it does not include the observation level random effect. However, when using the same formular for glmmTMB i get this message:

mydata_select$predictAll<-predict(Mod, type= "response",re.form=~(1|Microchip))
Error in predict.glmmTMB(SelMod2, type = "response", re.form = ~(1 | Microchip)) : 
  re.form must equal NULL, NA, or ~0

How can i specify to only account for the Microchip random effect and not the observation level random effect?

Any suggestions are welcome. I am sure there must be an easy way around this, but I haven't been able to find it.

Cheers, Sofie

  • It doesn’t make sense (at least to me) to call for a “prediction” without a value for both fixed and random effects. The random effects serve the same role as an intercept in an ordinary linear model. You might get satisfaction by seeking to extract an effect measure. – IRTFM Oct 14 '21 at 04:56
  • Please consider providing us a [minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so that we can help you in the best possible way – lovalery Oct 14 '21 at 22:07

0 Answers0