Tutorials › Generalized Linear Models › Exposure Offsets Under Log Links

Offsets Weights and Trials · Tutorial 121 of 981

Exposure Offsets Under Log Links

See why known exposure enters a log-link count model as an offset and how to interpret fitted counts and rates when exposure varies.

Intermediate 11 min read

What You'll Learn

  • Derive the log-exposure offset from a mean proportional to known exposure.
  • Distinguish the linear predictor for expected counts from the modeled rate.
  • Calculate fitted counts and rates for observations with different exposures.
  • Interpret covariate effects as rate ratios under a log link.
  • Check how changing exposure units affects the offset and model intercept.
  • Recognize why modeling counts without accounting for exposure can mislead.

Why Exposure Belongs in a Count Model

A count of events cannot usually be interpreted without knowing how long, or how much, was observed. Ten events in 100 person-days and ten events in 1,000 person-days are not evidence of the same event frequency. When expected counts are proportional to known exposure, the log link gives a direct way to account for exposure while modeling the rate through covariates.

The key distinction is between the expected count for an observation and its expected rate per unit of exposure. A log-link model for counts has exposure in its linear predictor, but the exposure term is known rather than estimated. Its logarithm is therefore included as an offset with coefficient fixed at one.

Definition: Let \(Y_i\) be a count observed over a known exposure \(t_i>0\), and let \(x_i\) be a covariate vector. Suppose the expected count is proportional to exposure, so that \(E[Y_i\mid x_i,t_i]=t_i\lambda_i\), where \(\lambda_i\) is the expected rate per exposure unit. Under a log link, model \(\log(\lambda_i)=x_i^\mathsf{T}\beta\). Equivalently, \(\log(E[Y_i\mid x_i,t_i])=\log(t_i)+x_i^\mathsf{T}\beta\). The known term \(\log(t_i)\), with coefficient fixed at one, is the exposure offset.

Here \(x_i\) may include an intercept, and \(\beta\) is the vector of regression coefficients. The rate \(\lambda_i\) is expressed per unit of whatever exposure was used: per person-day, per machine-hour, or per kilometre, for example. The model assumes proportionality of expected count to exposure, conditional on the covariates. It does not claim that every realized count is proportional to exposure.

From a Rate Model to an Offset

The offset follows directly by taking logarithms of the mean-count relationship. If \(\mu_i=E[Y_i\mid x_i,t_i]\) and \(\mu_i=t_i\lambda_i\), then

$$ \log(\mu_i)=\log(t_i)+\log(\lambda_i). $$

Modeling the log rate as \(x_i^\mathsf{T}\beta\) therefore gives a log mean count with the known term \(\log(t_i)\). Conversely, subtracting the offset from the log mean gives the log rate. This is why the offset is not an additional estimated coefficient: allowing its coefficient to vary would no longer impose the stated proportional relationship between exposure and expected count.

Theorem: If \(t_i>0\) is known and the conditional mean satisfies \(\mu_i=t_i\lambda_i\), then the log-link model \(\log(\lambda_i)=x_i^\mathsf{T}\beta\) is equivalent to the offset model \(\log(\mu_i)=\log(t_i)+x_i^\mathsf{T}\beta\). Under this model, the expected rate is \(\lambda_i=\mu_i/t_i=\exp(x_i^\mathsf{T}\beta)\).

Proof. Since \(t_i>0\), its logarithm is defined. Starting with the rate model and the mean-count relationship,

$$ \mu_i=t_i\lambda_i =t_i\exp(x_i^\mathsf{T}\beta). $$

Taking logarithms gives

$$ \log(\mu_i)=\log(t_i)+x_i^\mathsf{T}\beta. $$

In the other direction, exponentiating this offset model gives \(\mu_i=t_i\exp(x_i^\mathsf{T}\beta)\). Dividing by \(t_i>0\) yields \(\mu_i/t_i=\exp(x_i^\mathsf{T}\beta)\), which is the modeled expected rate. Thus the two formulations describe the same mean relationship. \(\square\)

Worked Example: Translating a Rate Model into Expected Counts

Suppose a Poisson count model uses person-days of follow-up as exposure. Its fitted log rate is \(x_i^\mathsf{T}\hat\beta=\log(0.02)+x_i\log(1.5)\), where \(x_i=0\) for the reference group and \(x_i=1\) for the treatment group. Calculate the fitted rate and expected count for a reference-group observation with 100 person-days, and a treatment-group observation with 200 person-days.

For the reference group, \(x_i=0\), so its fitted rate is

$$ \hat\lambda_i=\exp\{\log(0.02)+0\log(1.5)\}=0.02 $$

events per person-day. Its fitted expected count is exposure times rate:

$$ \hat\mu_i=100(0.02)=2. $$

For the treatment group, \(x_i=1\), so its fitted rate is

$$ \hat\lambda_i =\exp\{\log(0.02)+\log(1.5)\} =0.02(1.5)=0.03 $$

events per person-day. With 200 person-days of exposure, the fitted expected count is

$$ \hat\mu_i=200(0.03)=6. $$

The treatment-group rate is 1.5 times the reference rate, while its expected count is three times as large: the rate ratio contributes a factor of 1.5 and the exposure is twice as large. The expected count is not itself the rate ratio.

What the Fitted Quantities Mean

For fitted coefficients \(\hat\beta\), the two predictions are

$$ \hat\mu_i=t_i\exp(x_i^\mathsf{T}\hat\beta), \qquad \hat\lambda_i=\frac{\hat\mu_i}{t_i}=\exp(x_i^\mathsf{T}\hat\beta). $$

Thus the fitted linear predictor including the offset, \(\log(t_i)+x_i^\mathsf{T}\hat\beta\), exponentiates to an expected count. Removing the offset before exponentiating gives the fitted rate. This distinction matters whenever exposure differs across observations. At identical covariate values, a fourfold increase in exposure produces a fourfold increase in the fitted expected count, but it leaves the fitted rate unchanged.

With a log link, a one-unit increase in a covariate \(x_{ij}\), holding the other covariates fixed, multiplies the modeled rate by \(\exp(\beta_j)\). Since exposure is unchanged in that comparison, it also multiplies the expected count by \(\exp(\beta_j)\). If exposure differs between observations, however, their count ratio combines the covariate effect and the exposure ratio.

Result: For two covariate vectors \(x_a,x_b\) and positive exposures \(t_a,t_b\), the fitted count ratio is $$ \frac{\hat\mu_a}{\hat\mu_b} =\frac{t_a}{t_b}\exp\{(x_a-x_b)^\mathsf{T}\hat\beta\}, $$ whereas the fitted rate ratio is $$ \frac{\hat\lambda_a}{\hat\lambda_b} =\exp\{(x_a-x_b)^\mathsf{T}\hat\beta\}. $$

Derivation. Substitute the fitted-mean formula for each observation and divide:

$$ \frac{\hat\mu_a}{\hat\mu_b} = \frac{t_a\exp(x_a^\mathsf{T}\hat\beta)} {t_b\exp(x_b^\mathsf{T}\hat\beta)} = \frac{t_a}{t_b}\exp\{(x_a-x_b)^\mathsf{T}\hat\beta\}. $$

By definition, \(\hat\lambda_i=\hat\mu_i/t_i=\exp(x_i^\mathsf{T}\hat\beta)\). Dividing these fitted rates cancels no exposure terms because none occur in the rate formula, giving the second expression. In particular, when \(x_a=x_b\), the rate ratio is one and the fitted count ratio is exactly \(t_a/t_b\). \(\square\)

Worked Example: Comparing Counts and Rates Across Exposures

A fitted model has rate \(\hat\lambda_i=0.01\exp(x_i\log 2)\) events per machine-hour. Compare the fitted expected counts and rates for a reference-machine observation with \(x_i=0\) and 50 machine-hours, and a high-setting observation with \(x_i=1\) and 200 machine-hours.

For the reference observation, the rate is \(0.01\) events per machine-hour. Its expected count is \(50(0.01)=0.5\) events.

For the high-setting observation, the rate is

$$ 0.01\exp(\log 2)=0.02 $$

events per machine-hour. Its expected count is \(200(0.02)=4\) events. The fitted rate ratio is \(0.02/0.01=2\), the covariate effect. The fitted count ratio is \(4/0.5=8\). The formula checks this result: the exposure ratio is \(200/50=4\), and the covariate rate ratio is 2, so the count ratio is \(4(2)=8\).

Expected counts need not be integers. A mean of 0.5 is a valid expected count; it does not mean that half an event is observed in a single observation.

Exposure Units and the Intercept

The numerical value of a rate depends on the unit of exposure. Changing from days to hours changes the number representing exposure and the number representing the rate, but should not change fitted expected counts. When the same data are expressed in a new exposure unit, the intercept must shift to express the same physical rate in that unit.

Result: Suppose the original exposure is \(t_i\), and the new exposure unit records \(t_i'=c\,t_i\) for a fixed \(c>0\). To preserve the fitted mean, use \(\beta_0'=\beta_0-\log(c)\) for an intercept coefficient, leaving the other coefficients unchanged. Then $$ t_i'\exp(x_i^\mathsf{T}\beta')=t_i\exp(x_i^\mathsf{T}\beta). $$

Proof. Write \(x_i^\mathsf{T}\beta=\beta_0+z_i^\mathsf{T}\gamma\), where the intercept is included and \(z_i\) contains the remaining predictors. Under the proposed conversion, \(\beta_0'=\beta_0-\log(c)\) and \(\gamma'=\gamma\). Therefore

$$ t_i'\exp(\beta_0'+z_i^\mathsf{T}\gamma') =c\,t_i\exp\{\beta_0-\log(c)+z_i^\mathsf{T}\gamma\} =t_i\exp(\beta_0+z_i^\mathsf{T}\gamma). $$

The last expression is the original fitted mean, so expected counts are unchanged. The rate per new unit is the old rate divided by \(c\), as required because each new unit represents \(1/c\) of the old unit. \(\square\)

Worked Example: Converting Person-Days to Person-Hours

A fitted model has rate \(0.02\) events per person-day for a particular covariate profile. For 3 person-days of exposure, the fitted expected count is

$$ 3(0.02)=0.06. $$

The same exposure is \(72\) person-hours. Since one day contains 24 hours, the rate per person-hour is \(0.02/24=0.0008333\ldots\). The expected count using hours is therefore

$$ 72\left(\frac{0.02}{24}\right)=3(0.02)=0.06. $$

In the offset representation, the exposure has been multiplied by \(c=24\). The intercept for the per-hour rate must decrease by \(\log(24)\), since \(\log(0.02/24)=\log(0.02)-\log(24)\). Changing the exposure unit without making this corresponding rate adjustment would change the fitted count rather than merely changing its units.

Common Mistakes and Practical Checks

  • Reading the full linear predictor as a log rate. It includes \(\log(t_i)\), so its exponential is the fitted expected count. Subtract the offset, or divide the fitted count by exposure, to obtain the fitted rate.
  • Comparing counts as if they were rates. A larger expected count may result from more exposure rather than a higher event rate. Compare fitted rates, or use the count-ratio formula and account for the exposure ratio.
  • Estimating an exposure coefficient when proportionality is intended. The standard exposure offset fixes the coefficient of \(\log(t_i)\) at one. Estimating it changes the assumption that expected counts scale proportionally with exposure.
  • Using zero or negative exposure in a log offset. The term \(\log(t_i)\) requires \(t_i>0\). An observation with zero exposure cannot be handled by simply taking its log offset; its data structure and inclusion in the analysis need to be considered separately.
  • Changing units but keeping the same rate intercept. A rate stated per hour is numerically different from the rate per day. Convert the rate consistently so the expected count remains unchanged.

The offset is especially useful in clinical and operational studies where follow-up differs across individuals, such as recurrent events per person-time or failures per machine-time. It lets the covariates describe rate differences while exposure determines how much opportunity there was to observe a count. Always report which exposure unit defines the rate, and distinguish the model-based expected count from the model-based rate.

Check Your Understanding

Use the offset and rate formulas to answer these questions.

  1. A count model has rate \(\exp(-3+0.2x_i)\) per day and exposure \(t_i\) days. Write its log-mean model and its expected-count formula.
  2. Two observations have the same covariates, but the second has three times the exposure of the first. What are the fitted count ratio and fitted rate ratio?
  3. A covariate coefficient is \(\log(1.4)\). Interpret its multiplicative effect on the modeled rate, holding other covariates fixed.
  4. A fitted expected count is 5 for an observation with 250 person-hours. What is its fitted rate per person-hour?
  5. If exposure values are converted from days to hours, what happens to the rate per unit and to the intercept if fitted expected counts are to stay unchanged?
Clinical Biostats