# Count data from unequal time frames

I have count data for events measured within each of multiple individuals. However, the amount of time over which each individual was observed varies. Normally, if the counts were obtained over equal amounts of time, I'd do something like:

fit = lmer(
data = my_data
, formula = count ~ (1|individual)
, family = poisson
)


However, I'm not sure how to handle things when the amount of time is unequal. If I simply divide each individual's count by the amount of time the were observed, this yields a counts-per-minute measure, but the poisson family does not like non-integer values in the dv. Any suggestions?

You simply add an offset term to the model:

i.e. if minutes is your exposure variable:

fit = lmer(
data = my_data
, formula = count ~ offset (log(minutes))+(1|individual)
, family = poisson
)


assuming minutes is strictly nonzero, if you have some 0 minutes, some will add a small amount, like .000001, to ensure log(minutes) is not NA.

Hope this helps.

Corey