AI Agents & Econometric Coding

Count data · Poisson regression

Poisson Regression with Exposure

An exposure offset converts event counts into comparable conditional rates.

Counts observed over unequal exposure

A count observed for ten person-years is not directly comparable with one observed for a single person-year. A Poisson offset fixes the coefficient on log exposure at one (Cameron and Trivedi, 2013).

$$ \log E[y_i\mid x_i,e_i]=x_i'\beta+\log e_i. $$

Equivalently, $E[y_i\mid x_i,e_i]/e_i=\exp(x_i'\beta)$.

A rate example

Suppose $\exp(x_i'\beta)=0.4$ events per unit of exposure.

Exposure $e_i$Expected countExpected rate
10.40.4
52.00.4
104.00.4

The offset scales the count while preserving the modeled rate.

Assumptions and implementation

The Poisson conditional mean must be specified correctly for consistent quasi-maximum-likelihood coefficients. The equality of conditional mean and variance is needed for model-based standard errors. Robust covariance can relax that variance restriction.

Exposure must be positive. Logging the exposure and estimating its coefficient changes the model. Some software accepts offset(log_e) and other software accepts exposure=e.

Three observation windows with proportional expected counts illustrate the offset restriction.

Interpretation and reporting

A slope coefficient in this model is a log rate ratio. Exponentiating $\beta_j$ gives the factor change in the expected event rate for one additional unit of $x_j$. The exposure coefficient is fixed at one, so changing exposure scales the expected count proportionally.

For the table, exposure rises from one to ten while the expected rate stays $0.4$. The expected count therefore rises from $0.4$ to $4.0$. This change describes a longer observation window, not a regressor effect.

Report rate ratios with uncertainty on the same multiplicative scale. State the exposure unit, such as person-years or machine-hours. Also identify the covariance estimator. Model-based covariance relies on Poisson variance, while robust covariance permits other conditional variance patterns.

Reproducible implementation

Verify that every retained exposure value is positive and measured in a common unit. Create $\log e_i$ once, then pass it as an offset with coefficient fixed at one. Do not include the same variable as an estimated regressor.

Check predictions in two forms. The count prediction is $\widehat\mu_i$, while the rate prediction is $\widehat\mu_i/e_i$. Multiply an exposure by a known factor and confirm that the predicted count changes by that factor.

Inspect residual patterns and the relation between conditional means and variances. Excess zeros or large overdispersion can motivate another count model. Save software syntax, the estimation sample, and the covariance option with the coefficient table (Cameron and Trivedi, 2013).

Further reading

Cameron and Trivedi develop count models, exposure, and robust inference (Cameron and Trivedi, 2013). McCullagh and Nelder place the model in the generalized-linear-model framework (McCullagh and Nelder, 1989).

Sources and further reading

  1. A. Colin Cameron, Pravin K. Trivedi. 2013. Regression Analysis of Count Data. Cambridge University Press. doi:10.1017/CBO9781139013567.
  2. Peter McCullagh, John A. Nelder. 1989. Generalized Linear Models. Chapman and Hall. doi:10.1007/978-1-4899-3242-6.

About this benchmark task

Status
In the benchmark
Identifier
poisson_offset
Family
Poisson regression
Software
Stata, R, Python
Source
Benchmark task set

Task statement

Estimate a Poisson regression of y_count on x1 and x2 with an intercept and an offset equal to the natural log of exposure. Report rows const, x1, and x2 with asymptotic model-based standard errors.

Required output

const, x1, x2

Open every recorded run for this task.