Tutorials › Generalized Linear Models › Offsets and Unequal Exposures in Quasi-Poisson Fits

Quasi-Binomial and Quasi-Poisson · Tutorial 712 of 981

Offsets and Unequal Exposures in Quasi-Poisson Fits

Use a fixed log-exposure offset to model rates and translate them into fitted counts for observations with different exposure amounts.

Intermediate 9 min read

What You'll Learn

  • Write a quasi-Poisson model with a known log-exposure offset
  • Interpret regression coefficients on the rate scale
  • Distinguish fitted rates from fitted expected counts
  • Derive the quasi-score equation when exposures differ
  • Calculate fitted counts and variances for new exposure amounts

Why Exposure Belongs in the Mean Model

A count depends both on the underlying rate and on how much opportunity there was for events to occur. Ten events observed over two days and ten events observed over twenty days are not evidence of the same event rate. A quasi-Poisson model with an exposure offset separates these quantities: covariates describe the rate, while known exposure scales the expected count.

Exposure might be person-time, length of follow-up, area surveyed, or another known amount of opportunity. The key assumption is proportionality: holding the modeled covariates fixed, doubling exposure doubles the expected count. A log link expresses that assumption by adding the logarithm of exposure to the linear predictor, with its coefficient fixed at one.

Definition: Let \(Y_i\) be a count and \(t_i>0\) a known exposure for observation \(i\). A quasi-Poisson regression with log link and log-exposure offset specifies $$ E[Y_i]=\mu_i,\qquad \operatorname{Var}(Y_i)=\phi\mu_i,\qquad \log(\mu_i)=\log(t_i)+x_i^\mathsf{T}\beta, $$ where \(\phi>0\) is the dispersion parameter, \(x_i\) is the covariate vector, and \(\beta\) is the regression coefficient vector. The quantity \(\log(t_i)\) is an offset: its coefficient is fixed at one, rather than estimated. The modeled rate per unit of exposure is \(r_i=\mu_i/t_i=\exp(x_i^\mathsf{T}\beta)\).

The quasi-Poisson specification concerns the mean and variance; it does not, by itself, assert a particular probability distribution for \(Y_i\). The offset changes the mean model, not the quasi-Poisson variance relationship. In particular, the fitted expected count is \(t_i\) times the fitted rate. A fitted rate need not be an integer, and neither does a fitted expected count.

Rates and Counts Are Different Predictions

The linear predictor \(x_i^\mathsf{T}\beta\) gives the log rate, not the log count. Exponentiating it gives a rate per unit of exposure. To obtain an expected count at exposure \(t_i\), multiply that rate by \(t_i\), or equivalently exponentiate the full linear predictor including the offset.

Worked Example: Interpreting a Rate Model

Suppose a model for hospital events uses a binary covariate \(x\), and its fitted coefficients are \(\hat\beta_0=-1.5\) and \(\hat\beta_1=\log(2)\). The exposure is measured in patient-years. Find the fitted rate and expected count for \(x=0\) with 8 patient-years, and for \(x=1\) with 20 patient-years.

For \(x=0\), the fitted rate is \( \exp(\hat\beta_0+\hat\beta_1\cdot 0)=\exp(-1.5)\approx 0.2231 \) events per patient-year. Thus the expected count over 8 patient-years is \(8(0.2231)\approx 1.785\).

For \(x=1\), the fitted rate is \( \exp(-1.5+\log(2))=2\exp(-1.5)\approx 0.4463 \) events per patient-year. The expected count over 20 patient-years is \(20(0.4463)\approx 8.925\).

The covariate doubles the rate, because its coefficient is \(\log(2)\). The larger exposure also increases the expected count. These are separate effects: the group with \(x=1\) has twice the rate, but its expected count is about five times as large because it also has \(20/8=2.5\) times the exposure.

This distinction is useful when reporting results. A rate comparison describes the modeled event intensity per exposure unit. A count prediction answers how many events are expected over a specified exposure. Reporting a count without specifying the exposure can therefore be incomplete.

What the Offset Does to the Quasi-Score

For a log link, the derivative of the log mean with respect to \(\beta\) is \(x_i\), since \(\log(t_i)\) is known and does not depend on \(\beta\). With the quasi-Poisson variance \(\phi\mu_i\), the quasi-score equation for \(\beta\) is \(\sum_i x_i(Y_i-\mu_i)/\phi=0\). The common factor \(1/\phi\) does not change its roots. Substituting \(\mu_i=t_i\exp(x_i^\mathsf{T}\beta)\) shows explicitly how exposure enters the estimating equation.

Result: The quasi-score equations for a quasi-Poisson log-link model with known offsets are $$ \sum_{i=1}^n x_i\left\{Y_i-t_i\exp(x_i^\mathsf{T}\beta)\right\}=0. $$ Thus observations contribute through their counts and exposures together; the fitted mean for observation \(i\) is \(t_i\exp(x_i^\mathsf{T}\beta)\).

To see the equation, the quasi-score contribution for a mean parameterized by \(\beta\) is \((Y_i-\mu_i)\{\partial\mu_i/\partial\beta\}/\operatorname{Var}(Y_i)\). Here \(\partial\mu_i/\partial\beta=\mu_i x_i\), and \(\operatorname{Var}(Y_i)=\phi\mu_i\). Therefore the contribution is \(x_i(Y_i-\mu_i)/\phi\). Summing and setting the result to zero gives the displayed equation after multiplying by \(\phi\).

Worked Example: Estimating a Common Rate From Unequal Exposures

Suppose two observations have counts \(Y_1=12\), \(Y_2=40\), and exposures \(t_1=4\), \(t_2=10\). Fit an intercept-only quasi-Poisson model with a common rate \(\lambda=\exp(\beta_0)\). Find the fitted rate and fitted counts.

The score equation for the intercept is \(Y_1+Y_2-\lambda(t_1+t_2)=0\), because \(x_i=1\) and \(\mu_i=t_i\lambda\). Substituting the data gives \(12+40-14\lambda=0\), so \(\hat\lambda=52/14=26/7\approx 3.7143\) events per exposure unit.

The fitted expected counts are \(\hat\mu_1=4(26/7)=104/7\approx14.8571\) and \(\hat\mu_2=10(26/7)=260/7\approx37.1429\). They sum to \(52\), matching the total observed count, as the intercept score equation requires.

The observed rates were \(12/4=3\) and \(40/10=4\). Their unweighted average is \(3.5\), which is not the fitted common rate: the model's intercept score uses total events divided by total exposure, \(52/14\). The longer-exposure observation contributes more exposure to this pooled rate.

Rate Variability and Exposure-Specific Predictions

Dividing a count by exposure gives an observed rate, but it does not make the variability of rates equal across observations. Under the stated quasi-Poisson mean and variance, short-exposure rates are more variable than long-exposure rates. This follows directly from the scaling of expectation and variance.

Result: If \(R_i=Y_i/t_i\) and \(t_i>0\) is fixed, then $$ E[R_i]=\exp(x_i^\mathsf{T}\beta),\qquad \operatorname{Var}(R_i)=\frac{\phi\exp(x_i^\mathsf{T}\beta)}{t_i}. $$

Indeed, division by the fixed constant \(t_i\) gives \(E[R_i]=E[Y_i]/t_i=\mu_i/t_i\), which equals \(\exp(x_i^\mathsf{T}\beta)\). It also gives \(\operatorname{Var}(R_i)=\operatorname{Var}(Y_i)/t_i^2=\phi\mu_i/t_i^2\). Since \(\mu_i=t_i\exp(x_i^\mathsf{T}\beta)\), this is \(\phi\exp(x_i^\mathsf{T}\beta)/t_i\). Thus equal modeled rates do not imply equal rate variances when exposures differ.

Worked Example: Predicting Counts at Two Exposure Times

Suppose the fitted rate model is \(\log(r)=\beta_0+\beta_1x\), with \(\hat\beta_0=\log(0.5)\), \(\hat\beta_1=\log(1.8)\), and estimated dispersion \(\hat\phi=1.6\). For a new observation with \(x=1\), calculate the fitted rate and expected counts at exposures of 6 and 18 units. Also calculate the model-based quasi-Poisson variances.

At \(x=1\), the fitted rate is \(\exp\{\log(0.5)+\log(1.8)\}=0.5(1.8)=0.9\) events per exposure unit.

For exposure 6, the fitted expected count is \(6(0.9)=5.4\), and its quasi-Poisson variance is \(\hat\phi\hat\mu=1.6(5.4)=8.64\).

For exposure 18, the fitted expected count is \(18(0.9)=16.2\), and its variance is \(1.6(16.2)=25.92\). The expected count triples when exposure triples, while the modeled rate stays \(0.9\). The noninteger fitted means are valid expected values, not claims that an observed count can be fractional.

Assumptions, Interpretation, and a Common Mistake

An offset is appropriate when exposure is known and the model assumes that expected counts are proportional to it at fixed covariates. It is not merely a convenient adjustment for observations that look different. If exposure changes the rate itself, that relationship must be represented in the covariate model rather than automatically imposed as a unit-coefficient offset. The exposure must be positive because \(\log(t_i)\) is undefined at zero; a zero-exposure record provides no rate information under this formulation.

A common mistake is to treat \(Y_i/t_i\) as the response and fit an ordinary quasi-Poisson log-link model to those rates while ignoring exposure. That does not reproduce the count model with an offset. For example, the rate variance derived above is proportional to \(1/t_i\), so rates from different exposures do not have the same variance even when their modeled means match. The direct count formulation keeps the exposure in the mean as \(t_i\exp(x_i^\mathsf{T}\beta)\).

Another error is to report \(\exp(x_i^\mathsf{T}\hat\beta)\) as a predicted count. That quantity is a rate per exposure unit. The predicted count for a specified exposure \(t_i\) is \(t_i\exp(x_i^\mathsf{T}\hat\beta)\). Always state the exposure units when presenting a rate and the exposure amount when presenting a count prediction.

Key takeaway: In a quasi-Poisson log-link model, \(\log(t_i)\) is a known offset that converts the covariate-based rate into an expected count. Compare rates to interpret covariates; multiply by the relevant exposure to predict counts.

Check Your Understanding

Use the offset model to distinguish a rate statement from a count prediction.

  1. Write the mean model for a quasi-Poisson count with exposure \(t_i\), covariates \(x_i\), and coefficient vector \(\beta\).
  2. If the fitted rate is 2.4 events per month, what is the fitted expected count over 5 months?
  3. In an intercept-only model, two records have 9 events over 3 units and 20 events over 5 units. Use the intercept score equation to find the fitted common rate.
  4. Why can two observations with the same fitted rate have different variances for their observed rates?
  5. What does a coefficient of \(\log(1.5)\) on a binary covariate imply about the fitted rate, holding other covariates fixed?
Clinical Biostats