11
$\begingroup$

I'm trying to help a student of a colleague. The student observed and counted bird behaviour (number of calls) in an experimental setup. The number of calls attributable to a specific observed bird during each experiment couldn't be determined but counting the number of birds that contributed to the number of calls recorded was possible. Hence my initial suggestion was to include the number of birds as an offset term in a Poisson GLM model, hence we would be fitting the expected number of calls per bird.

The problem with this is that during many observation occasions no birds (and hence no calls) were observed. The software (R in this case) complains because $\log(0) = -\inf$ (R complains about y containing -Inf data but that is purely the result of offset(log(nbirds)) being -Inf).

I actually suspect we need a hurdle model (or similar) where we have a separate binomial model for "calls observed?" (or not) and a truncated count model for the number of calls (per bird) in situations where there were calls, where we include the offset term only in the count part of the model.

Having tried this using the pscl package in R, but I'm still getting the same error:

mod1 <- hurdle(NumberCallsCOPO ~ Condition * MoonVis +
               offset(log(NumberCOPO)) | 1, data = Data,
               dist = "poisson")

because the same R code (glm.fit is used internally by hurdle() to fit the count model part) is checking for -Inf even though I don't think it would affect the model fit for those observations. (Is that a correct assumption?)

I can get the model to fit by adding a small number to NumberCOPO (say 0.0001) but this is a fudge at best.

Would adding this small continuity correction be OK in practice? If not, what other approaches should we be considering when handling data where we might want to use an offset in a Poisson model where the offset variable can take the value 0? All of the examples I have come across are for situations where a 0 would not be possible for the offset variable.

$\endgroup$
3
  • 2
    $\begingroup$ In this case, it seems like your model is trying to fit a tautology: if there are 0 birds observed you'll also hear 0 birdcalls. I'm not convinced that fitting a model to rows with offset 0 is appropriate in this case. $\endgroup$
    – Sycorax
    Commented Feb 2, 2015 at 20:38
  • $\begingroup$ Thanks, as I mentioned below, that is my gut reaction too. I've expanded a little in my reply to Barry (Spacedman)'s Answer below. $\endgroup$ Commented Feb 2, 2015 at 20:54
  • 2
    $\begingroup$ I would agree with the comments that imply that Poisson rate model (that is, with the offset term) is inappropriate for those cases (and you are right saying that maybe a separate, such as binomial, model should be applied to incorporate those cases). Rate cannot be based on zero denominator. $\endgroup$
    – ttnphns
    Commented Feb 2, 2015 at 21:07

3 Answers 3

7
$\begingroup$

So the response you want to model is "Number of calls per bird" and the troublesome lines are where you didn't observe any birds? Just drop those rows. They add no information to the thing you are trying to model.

$\endgroup$
3
  • $\begingroup$ That's my gut reaction too; probably overthinking this, but I can envisage situation where birds observed but no calls made. Hence the hurdle model, but internally it is still using glm.fit which throws a wobble even if those values don't count in the count part of the model. I suppose I could do the hurdle model by hand but I don't want to do this, just advise the student. $\endgroup$ Commented Feb 2, 2015 at 20:52
  • 3
    $\begingroup$ If you have a lot of zero calls made from non-zero observed birds you might want to do a zero-inflated poisson model (or similar) but that's very different from zero observed birds when you are interested in the number of calls per bird. $\endgroup$
    – Spacedman
    Commented Feb 2, 2015 at 21:05
  • $\begingroup$ In this case I don't think we have many of those; throwing out the 0-observed-birds data and fitting with a negative binomial seems to be a reasonable first step. $\endgroup$ Commented Feb 2, 2015 at 21:43
2
$\begingroup$

In a Poisson GLM, an offset is simply a multiplicative scaling on the Poisson rate being modelled - and a Poisson with a rate of zero is not helpful or even meaningful...

That's why Spacedman is correct!

$\endgroup$
0
$\begingroup$

Just try to do it (Hurdle) "by hand (for "didactic/gymnastic" purporse) : split to binomial part and cout part and anjoy fitting logit and cout regression separatedly! Or use standart Hurdle models (+ Vuong test) Poisson/ negBin/ Gamma..., GAM. You dont need the "offset" var here, seems to me. ;-)

$\endgroup$

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.