I have a data set that consists of video observations of carpenter bee nests under three treatments: a control, mothers removed and mothers and worker removed. I have counts of twenty behaviours as response variables, and I am looking at how each differs between treatments. There are different numbers of nests under each treatment, and different numbers of observations in each nest, so I have treated nest as a random factor, e.g for biting behavior:

glmmTMB(Biting ~ treatment + (1|nest), offset=log(noBees), data=biteTest, ziformula=~1, family="poisson")

As the number of bees in an observation is predictive of the number of behaviours I would like to fit a model in glmmTMB with the number of bees in an observation as exposure/offset, and another with total behaviours as exposure/offset. Because some observations have no bees visible, and some have no activity, I have the problem of a zero offset for some observations.

My intuition is to drop the zero observations, but I am concerned that this may bias my data to treatments with more bees/activity. Shouldn't observations of zero bees/activity be important to understanding the difference between treatments? If I drop the zeros how do I justify this statistically, perhaps with a reference to a published paper. I am struggling to find similar examples in ecological or behavioural literature.

My other thought was to include + 1 in my offset, but then I'm not sure how to interpret estimated marginal effects (means).


In a Poisson (or negative binomial model) your offset would normally be on the logarithm-scale. E.g. if you want to model events per time units, then you use log(observation time) as your offset (as you actually seem to do in your code). That's because if your random variable is Y and your observation time is t, and we assume $\log(\text{E}Y/t) = \boldsymbol{x}\boldsymbol{\beta}$, then $\log(\text{E}Y) = \boldsymbol{x}\boldsymbol{\beta} + \log t$.

So, if you want to model behaviours per animal (and an animal can be counted more than once for a behavior), then a log(number of animals seen) offset seems to make sense. Obviously, you don't get a number you can use from log(0 animals), but that is fine in the sense that there cannot be any behaviors by animals, if there are zero animals.

Another similar option could be to model the number of animals showing a behaviour (but then we cannot double count the same animal showing a behavior more than once) as binomial with the number of trials being the number of animals.

Of course, if there is information in there being no animals, then both of these are the wrong models. Or perhaps you look at the two questions seperately? I.e. look at the count of animals seen and separately look at events of the behavior in question per animal?

| cite | improve this answer | |
  • $\begingroup$ Thank you Björn. Yes, indeed I left out that I am using the log of the number of bees in my description. That is very helpful. I am still uncertain about how correct my model is. If I drop the zeros, would I still be able to treat my results as an unbaised estimate of the effect of my treatments on the number of behaviours per bee? $\endgroup$ – Pierre Raynard Mar 18 at 16:44
  • $\begingroup$ It seems like a matter of what your question is. Is your question:"Given (conditional on) the number of bees I see, how many of these show the behaviour I am interested in?" That implicitly means you do not "care" (for the purpose of this question - or you will look at that separately), whether the treatments killed any bees that are not visible, made them huddle in the hive or made them fly away in confusion. $\endgroup$ – Björn Mar 19 at 11:28
  • $\begingroup$ Absolutely, agreed. If I do not think the treatments influenced the zero observations then I can justify it biologically. As long as there is no purely mathematical reason that it would bias my results, that makes sense. Thank you again Bjorn. $\endgroup$ – Pierre Raynard Mar 19 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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