I have seen several posts on using offset VS using weights, however I cannot locate anything about using both of those features.
The problem is as follows: I model the number of occurred events (k). In the data, apart from covariates, I have also a number of expected events (e) and number of exposure units (n).
I want the model to be a Poisson regression of a form (in pseudocode):
log(k) ~ offset(e) + covariates
…in other words, occurred (k) will be modelled as expected (e) multiplied by some coefficients.
However, since the model above does not use any information about exposure units, I also included (in R’s glm function) the term: weights=n. In my understanding, it just made sense, so that an observation of 1000 exposures and 1 event is not treated in the same way as a observation of 10 exposures and 1 event.
And here’s the pickle: if I fit such model and try to predict the events on the training data, I do not get the total of k back. I get this number only if I do NOT use weights.
What is incorrect in my approach? Should I give up weights for a Poisson regression or should I continue with them and just ‘accept’ the difference in total predicted number?