1

First of all, I am using R. I know that we can model a frequency-response variable with a poisson regression, if we remember to weight it, so that the variance doesn't get affected by it. I am not entirely sure what is happening. My exposure ranges from 0 to 1. When i encode the glm in R in two equivalent ways (see below), i get similar summary outputs, but when i run dispersiontest, it gives me different results.

$glm( Y \sim X_1 + X_2 + offset(log(exposure)), family=poisson("log”)$

$glm( \frac{Y}{exposure}\sim X_1 + X_2, weights = exposure, family=poisson("log")$

Let's say that the Y's are simulated to be poisson distributed. When I run a dispersiontest in the AER package, I get overdispersion in the second method, probably meaning that the dispersiontest cannot be used when we model a frequency. Am i right?

ReneBt
  • 2,863
  • 1
  • 8
  • 24
OBIEK
  • 43
  • 5
  • If you have 0 exposure (denominator) wouldn't those observations necessarily have $Y=0$? If not, major data issue. If so, sounds like this issue is a semantic one that's easily solved by subsetting the data to include positive exposure only. – AdamO Mar 04 '20 at 22:53
  • The exposure lies in the interval (0,1] so 0 is not included. However when i take the logarithm, it gives me negative exposures. Can I freely transform the exposures (for example multiply with 10000) without changing any results? – OBIEK Mar 04 '20 at 23:02
  • I don't have any issue putting fractional "exposure" into GLM. Try `w = 0.5` and `y=1` and `glm(y~1 + offset(log(w)), family=poisson)`. I think you need to give more details. Might be a stackoverflow question at its heart. – AdamO Mar 04 '20 at 23:16
  • Ouch thats because I used a "comma" in front of offset instead of a "plus". Thats just something I spent all day on, and its just a single typoerror. Thanks regardless – OBIEK Mar 04 '20 at 23:49
  • See https://stats.stackexchange.com/questions/297859/can-weights-and-offset-lead-to-similar-results-in-poisson-regression and https://stats.stackexchange.com/questions/264071/how-is-a-poisson-rate-regression-equal-to-a-poisson-regression-with-correspondin – kjetil b halvorsen Mar 05 '20 at 13:15

0 Answers0