34
$\begingroup$

(First of all, just to confirm, an offset variable functions basically the same way in Poisson and negative binomial regression, right?)

Reading about the use of an offset variable, it seems to me that most sources recommend including that variable as an option in statistical packages (exp() in Stata or offset() in R). Is that functionally the same as converting your outcome variable to a proportion if you're modeling count data and there is a finite number that the count could have happened? My example is looking at employee dismissal, and I believe the offset here would simply be log(number of employees).

And as an added question, I am having trouble conceptualizing what the difference is between these first two options (including exposure as an option in the software and converting the DV to a proportion) and including the exposure on the RHS as a control. Any help here would be appreciated.

$\endgroup$
13
  • 1
    $\begingroup$ Not correct about choosing offset. Usually you will want the offset to be the log(number at risk) or log(person-time) since the link is log(). $\endgroup$
    – DWin
    Commented Aug 8, 2013 at 6:33
  • 3
    $\begingroup$ A quick comment on using offsets -- these are in most instances vital to having an appropriate model. I tell students that the need for the offset variable is to compare rates of events between groups [or covariate values] rather than comparing the absolute counts of events -- with the former almost always being our question of interest. $\endgroup$ Commented Aug 8, 2013 at 22:56
  • 1
    $\begingroup$ @JamesStanley: Your comments are very helpful. As you might have guessed I am an R (and former GLIM) user. I'm thinking that Stata's authors might have saved us all some confusion by naming the "exp" function "expected". I would have imagined it to be the exponential function (as it is in almost every other language.) $\endgroup$
    – DWin
    Commented Aug 8, 2013 at 23:43
  • 1
    $\begingroup$ @Dwin: Some slight idiosyncracies of Stata come into play in that it allows options to be specified in shortened form -- the full option name is exposure but one can shorten this to exp or e or anything in-between! (and as you'd expect, exp used as a simple function, rather than an option as to the poisson command here, returns the exponential -- e.g. disp exp(1) prints 2.7182818 to screen) $\endgroup$ Commented Aug 8, 2013 at 23:57
  • 1
    $\begingroup$ Ugh. Partial name matching. (R has some of that, too.) $\endgroup$
    – DWin
    Commented Aug 8, 2013 at 23:59

2 Answers 2

74
$\begingroup$

Recall that an offset is just a predictor variable whose coefficient is fixed at 1. So, using the standard setup for a Poisson regression with a log link, we have:

$$\log \mathrm{E}(Y) = \beta' \mathrm{X} + \log \mathcal{E}$$

where $\mathcal{E}$ is the offset/exposure variable. This can be rewritten as

$$\log \mathrm{E}(Y) - \log \mathcal{E} = \beta' \mathrm{X}$$ $$\log \mathrm{E}(Y/\mathcal{E}) = \beta' \mathrm{X}$$

Your underlying random variable is still $Y$, but by dividing by $\mathcal{E}$ we've converted the LHS of the model equation to be a rate of events per unit exposure. But this division also alters the variance of the response, so we have to weight by $\mathcal{E}$ when fitting the model.

Example in R:

library(MASS) # for Insurance dataset

# modelling the claim rate, with exposure as a weight
# use quasipoisson family to stop glm complaining about nonintegral response
glm(Claims/Holders ~ District + Group + Age,
    family=quasipoisson, data=Insurance, weights=Holders)

Call:  glm(formula = Claims/Holders ~ District + Group + Age, family = quasipoisson, 
    data = Insurance, weights = Holders)

Coefficients:
(Intercept)    District2    District3    District4      Group.L      Group.Q      Group.C        Age.L        Age.Q        Age.C  
  -1.810508     0.025868     0.038524     0.234205     0.429708     0.004632    -0.029294    -0.394432    -0.000355    -0.016737  

Degrees of Freedom: 63 Total (i.e. Null);  54 Residual
Null Deviance:      236.3 
Residual Deviance: 51.42        AIC: NA


# with log-exposure as offset
glm(Claims ~ District + Group + Age + offset(log(Holders)),
    family=poisson, data=Insurance)

Call:  glm(formula = Claims ~ District + Group + Age + offset(log(Holders)), 
    family = poisson, data = Insurance)

Coefficients:
(Intercept)    District2    District3    District4      Group.L      Group.Q      Group.C        Age.L        Age.Q        Age.C  
  -1.810508     0.025868     0.038524     0.234205     0.429708     0.004632    -0.029294    -0.394432    -0.000355    -0.016737  

Degrees of Freedom: 63 Total (i.e. Null);  54 Residual
Null Deviance:      236.3 
Residual Deviance: 51.42        AIC: 388.7
$\endgroup$
2
  • 3
    $\begingroup$ This is an excellent answer, thank you for clarifying the algebraic identity. $\endgroup$
    – fmark
    Commented Oct 25, 2013 at 1:43
  • 2
    $\begingroup$ Fantastic answer $\endgroup$ Commented Dec 10, 2016 at 23:23
4
$\begingroup$

The offset does act similarly for both Poisson and NB. The offset has two functions. For Poisson models, the actual number of events defines the variance, so that's needed. It also provides the denominator, so you can compare rates. It's unite-less.

Just using a ratio will mess up the standard errors. Having a model,that deals with the offset as most Poisson regression model functions do takes care of both the standard errors AND comparing rates.

$\endgroup$
3
  • 2
    $\begingroup$ What do you mean by mess up the SEs? $\endgroup$
    – dimitriy
    Commented Aug 8, 2013 at 21:45
  • $\begingroup$ Is the reasoning here that the ratio will no longer properly fit the Poisson distribution? $\endgroup$
    – RickyB
    Commented Aug 8, 2013 at 21:50
  • 9
    $\begingroup$ Thread necromancy, but for anyone reading this in 2017, I think this means converting to a ratio erases the information from the total number of trials: 1 out of 10 should have a different SE than 10 out of 100, but they both get converted to 0.1. $\endgroup$
    – Patrick B.
    Commented Oct 5, 2017 at 23:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.