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?