Model Fitting: Generalized Linear Models |
In this example, you examine another example of a generalized linear model: Poisson regression. A Poisson regression analysis might be appropriate when the response variable represents counts or rates. If your explanatory variables are all nominal (that is, you can write a contingency table containing the data), then the Poisson model is often called a log-linear model.
Counts are always nonnegative, whereas a linear model can
predict negative values for the response.
Consequently, it is common to choose a
logarithmic link function for the response. That is, if the response
variable is and the expected value of
is
, a Poisson
regression finds parameters that best fit the
data to the model
.
Sometimes the counts represent the number of events that occurred
during an observed time period. Some counts might correspond to longer
time periods than others do. In this situation, you want to model the
rate at which the events occur.
When you model a rate, you are modeling the number of events, , per unit
of time,
. The expected value of the rate is
, where
is
the expected value of
. In this case, the Poisson model
is
. By using the fact that
, this equation can be rewritten as
The example in this section fits a Poisson model to data in the
Ship data set. The data and analysis are from
McCullagh and Nelder (1989). The response variable, Y, is the number
of damage incidents that occurred during the number of months that
ship was in service (contained in the months variable).
As discussed in the previous paragraph, the quantity
is an offset variable for this model.
The three classification variables are as follows:
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.