# Should you always weight observations by exposure in a Poisson/Rate GLM

There are many great posts here on the importance of using an offset in a rate regression.

For example, if you are modeling the the propensity of murder in towns, using population of town $$n_i$$ and number of murders $$y_i$$, you might model as

$$\lambda_i = y_i / n_i = e^{\beta_0 + \beta_1 x_1 + ... + \beta_k x_k + \epsilon_i}$$

$$log(y_i / n_i) = \beta_0 + \beta_1 x_1 + ... + \beta_k x_k + \epsilon_i$$

$$log(y_i) - log(n_i) = \beta_0 + \beta_1 x_1 + ... + \beta_k x_k + \epsilon_i$$

$$log(y_i) = log(n_i) + \beta_0 + \beta_1 x_1 + ... + \beta_k x_k + \epsilon_i$$

The $$log(n_i)$$ term here would be an offset.

Now, you want to estimate $$\beta_0$$, $$\beta_1$$, .., $$\beta_k$$ using a GLM

In the GLM, do you want to also weight observations by $$n_i$$ in the variance matrix?

I would imagine that you do, since you would expect a small town, with population, say, 100, to have a higher variance in reported murders, per capita, then a large city. But maybe this is already factored into the GLM in the MLE process somewhere else?

What are weights in a binary glm and how to calculate them? has the following comment as a footnote, but I don't understand it:

Similar considerations apply to other count-based GLM families such as Poisson and negative binomial. You can only set the GLM prior weights for those families to a value other than 1 if you are willing to embrace a quasi-likelihood model.

In another comment a highly-ranked user mentions the need for weights as well: When to use an offset in a Poisson regression?

No, you don't want to weight observations by $$n_i$$. The weight is already taken care of. There are a couple of ways to think about this.

• This is (or could be, depending on assumptions) maximum likelihood, so you shouldn't be doing any ad hoc messing with weights
• the combined effect of a variance function $$V(\mu)=\mu$$ and an offset of $$\log n_i$$ and a log link is to multiply the variance by $$\exp(\log n_i))=n_i$$

You can use weights and a rate as the outcome instead of counts and an offset:

> data("leukemia",package="survival")
> coef(summary(glm(status~offset(log(time))+x,data=aml,family=quasipoisson)))
Estimate Std. Error  t value     Pr(>|t|)
(Intercept)    -4.1014620  0.4183594 -9.80368 2.738519e-09
xNonmaintained  0.9580938  0.5351672  1.79027 8.784025e-02
> coef(summary(glm(I(status/time)~x,weights=time,data=aml,family=quasipoisson)))
Estimate Std. Error   t value     Pr(>|t|)
(Intercept)    -4.1014620  0.4183589 -9.803692 2.738462e-09
xNonmaintained  0.9580938  0.5351672  1.790270 8.784024e-02


The offset is better in the sense that it can be a model for what you think is actually happening, but that's the only difference.

• A thought that I always had with regards to inserting the offset in glms, is with regards to the few situations where the denominator of the rate can be related to the rate itself. In those situations, it makes sense to introduce the denominator as a regular covariate, right? Dec 23 '20 at 1:25
• @GuilhermeMarthe I think that is correct. Going back to my example of murders per capital, allowing the denominator of rate (the town's population) to be a covariate would be allowing small towns to have a higher murder rate than large towns, all other covariates being equal. Dec 23 '20 at 1:46
• Yes, you could reasonably fit a model with a coefficient for $\log n$, though I would tend to put the offset in as well, so that the coefficient in the model measures the departure from a multiplier of 1. Dec 23 '20 at 4:18