SPSS Data Analysis Examples
Poisson Regression

Poisson regression is used to model count variables.

Please note: The purpose of this page is to show how to use various data analysis commands.  It does not cover all aspects of the research process which researchers are expected to do.  In particular, it does not cover data cleaning and checking, verification of assumptions, model diagnostics or potential follow-up analyses.

This page is done using SPSS 19. 

Examples of Poisson regression

Example 1.  The number of persons killed by mule or horse kicks in the Prussian army per year. Ladislaus Bortkiewicz collected data from 20 volumes of Preussischen Statistik.  These data were collected on 10 corps of the Prussian army in the late 1800s over the course of 20 years.

Example 2.  The number of people in line in front of you at the grocery store.  Predictors may include the number of items currently offered at a special discounted price and whether a special event (e.g., a holiday, a big sporting event) is three or fewer days away.

Example 3.  The number of awards earned by students at one high school.  Predictors of the number of awards earned include the type of program in which the student was enrolled (e.g., vocational, general or academic) and the score on their final exam in math.

Description of the Data

For the purpose of illustration, we have simulated a data set for Example 3 above: poisson_sim.sav. In this example, num_awards is the outcome variable and indicates the number of awards earned by students at a high school in a year, math is a continuous predictor variable and represents students' scores on their math final exam, and prog is a categorical predictor variable with three levels indicating the type of program in which the students were enrolled. 

Let's start with loading the data and looking at some descriptive statistics.

GET
  FILE='poisson_sim.sav'.
  
  DESCRIPTIVES
  VARIABLES=math num_awards
  /STATISTICS=MEAN STDDEV VAR MIN MAX .

Each variable has 200 valid observations and their distributions seem quite reasonable. The unconditional mean and variance of our outcome variable are not extremely different. Our model assumes that these values, conditioned on the predictor variables, will be equal (or at least roughly so).

Let's continue with our description of the variables in this dataset. The table below shows the average numbers of awards by program type and seems to suggest that program type is a good candidate for predicting the number of awards, our outcome variable, because the mean value of the outcome appears to vary by prog. Additionally, the means and variances within each level of prog--the conditional means and variances--are similar.

MEANS tables = num_awards by prog.




GRAPH
  /HISTOGRAM=num_awards.

Analysis methods you might consider

Below is a list of some analysis methods you may have encountered.  Some of the methods listed are quite reasonable, while others have either fallen out of favor or have limitations. 

Poisson regression

Below we use the genlin command to estimate a Poisson regression model. We have one continuous predictor and one categorical predictor. In the genlin line, we list our categorical predictor prog after "by" and our continuous predictor math after "with". Both appear in the model line. We use the covb=robust option in the criteria line to obtain robust standard errors for the parameter estimates as recommended by Cameron and Trivedi (2009) to control for mild violation of the distribution assumption that the variance equals the mean. Finally, we ask SPSS to print out the model fit statistics, the summary of the model effects, and the parameter estimates.

GENLIN num_awards BY prog WITH math
  /MODEL prog math INTERCEPT=YES
   DISTRIBUTION=POISSON LINK=LOG
  /CRITERIA COVB=ROBUST
  /PRINT FIT SUMMARY SOLUTION.

Sometimes, we might want to present the regression results as incident rate ratios. These IRR values are equal to our coefficients from the output above exponentiated and we can ask SPSS to print solution(exponentiated).

GENLIN num_awards BY prog WITH math
  /MODEL prog math INTERCEPT=YES
  DISTRIBUTION=POISSON LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST
  /PRINT SOLUTION (EXPONENTIATED).
The output above indicates that the incident rate for [prog=2] is 2.042 times the incident rate for the reference group, [prog=3].  Likewise, the incident rate for [prog=1] is 0.691 times the incident rate for the reference group holding the other variables at constant.  The percent change in the incident rate of num_awards is an increase of 7% for every unit increase in math.

Recall the form of our model equation:

log(num_awards) = Intercept + b1(prog=1) + b2(prog=2) + b3math.

This implies:

num_awards = exp(Intercept + b1(prog=1) + b2(prog=2)+ b3math) = exp(Intercept) * exp(b1(prog=1)) * exp(b2(prog=2)) * exp(b3math)

The coefficients have an additive effect in the log(y) scale and the IRR have a multiplicative effect in the y scale.

For additional information on the various metrics in which the results can be presented, and the interpretation of such, please see Regression Models for Categorical Dependent Variables Using Stata, Second Edition by J. Scott Long and Jeremy Freese (2006).

To understand the model better, we can use the emmeans command to calculate the predicted counts at each level of prog, holding all other variables (in this example, math) in the model at their means.

GENLIN num_awards BY prog WITH math
  /MODEL prog math INTERCEPT=YES
  DISTRIBUTION=POISSON LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=ROBUST
  /PRINT NONE
  /EMMEANS TABLES=prog SCALE=ORIGINAL.

In the output above, we see that the predicted number of events for level 1 of prog is about .21, holding math at its mean.  The predicted number of events for level 2 of prog is higher at .62, and the predicted number of events for level 3 of prog is about .31. Note that the predicted count of level 2 of prog is (.62/.31) = 2.0 times higher than the predicted count for level 3 of prog. This matches what we saw in the IRR output table.

Below we will obtain the predicted counts for each value of prog at two set values of math: 35 and 75.

GENLIN num_awards BY prog WITH math
  /MODEL prog math INTERCEPT=YES
  DISTRIBUTION=POISSON LINK=LOG
  /PRINT NONE
  /EMMEANS TABLES=prog CONTROL =math(35) SCALE=ORIGINAL.
    

GENLIN num_awards BY prog WITH math
  /MODEL prog math INTERCEPT=YES
  DISTRIBUTION=POISSON LINK=LOG
  /PRINT NONE
  /EMMEANS TABLES=prog CONTROL =math(75) SCALE=ORIGINAL.

    

The table above shows that with prog=1 and  math held at 35, the average predicted count (or average number of awards) is about .06; when math = 75, the average predicted count for prog=1 is about 1.01. If we look at these predicted counts at math = 35 and math = 75, we can see that the ratio is (1.01/0.06) = 16.8. This matches (within rounding error) the IRR of 1.0727 for a 40 unit change: 1.0727^40 = 16.1.

Things to consider

See also

References

 

How to cite this page

Report an error on this page or leave a comment

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.