Spss Poisson Regression
Spss Poisson Regression
Spss Poisson Regression
Generalized Linear Models can be fitted in SPSS using the Genlin procedure. This
procedure allows you to fit models for binary outcomes, ordinal outcomes, and models
for other distributions in the exponential family (e.g., Poisson, negative binomial,
gamma).
We will be using data from Apple Tree Dental for these examples. This dataset is
based on elderly nursing home residents, and was collected as part of Grant
R03DE16976-01A1 ("Dental Utilization by Nursing Home Residents: 1986-2004",
National Institute of Dental and Craniofacial Research), Barbara J. Smith, Principal
Investigator.
There are 987 patients in this database, with baseline ages from 55 to 102 years.
They all entered the program in 1992, and were followed for a maximum of 5 follow-
up periods. Each period was from 0 days to 547 days long. A participant could have
had a period of zero days length if they came to the program, had their initial dental
visit, and then never returned for any follow-up visits. We will be taking a look at the
number of claims that these participants made for diagnostic dental services during
their first period with Apple Tree Dental, and then over the five possible periods in
the dataset. We are mainly interested in comparing three different levels of
functional dentition, FUNCTDENT, 0: Edentulous, 1: < 20 teeth, and 2: >=20 teeth. We
will also control for other covariates in the analysis.
We first import the SAS dataset, Appletree.sas7bdat, into SPSS. The commands
below were pasted, but the method is to go to File > Open > Data… and choose the file
type as SAS (*.sas7bdat, *.sd7, *.sd2, *.ssd01,*.xpt).
GET
SAS DATA='C:\Documents and Settings\kwelch\Desktop\b510\appletree.sas7bdat'.
DATASET NAME DataSet1 WINDOW=FRONT.
We set up value labels for each level of functdent, and select for analysis only those
cases in Period 1.
value labels functdent (0) Edentulous (1) <20 teeth (2) >=20 teeth.
USE ALL.
1
COMPUTE filter_$=(Period=1).
FILTER BY filter_$.
EXECUTE.
We can see that there is a skewed distribution for this variable, which can be
expected, because these values represent counts.
Next, we modify the dataset to create a new categorical variable, NURSBEDS, which
has a value of 1: 100 or fewer beds, 2: 101-150 beds, or 3: >150 beds in the nursing
home where the participant lived. We also calculate the length of the period in years,
rather than days, so the estimated mean values for the outcome will be based on
annual, rather than daily rates of usage. We then take the natural log of the number
of years, after adding .0001 to the value, so the zero values will not be excluded. This
new variable, LOG_PERIOD_YR, will be the offset variable in our Poisson regression
model.
2
We now fit a Poisson regression model by going to Analyze > Generalized Linear
Models > Generalized Linear Models.
In the Predictors tab you can set up the categorical predictors (Factors) and the
continuous predictors (Covariates). We choose FUNCTDENT, SEX, BASEAGE, and
NURSEBEDS as "Factors" (because we wish SPSS to treat them as categorical
predictors). We choose BASEAGE as a "Covariate" because we want SPSS to treat it
as a continuous predictor (this would also be true for 0,1 indicator variables). Be sure
to choose LOG_PERIOD_YR as the OFFSET variable.
In the Estimation tab, we admire the settings and leave them as they are.
In the Statistics tab, make sure Type III is chosen as the Analysis Type, You have
the option of choosing Chi-Square Statistics as either Wald or Likelihood Ratio. We
will choose Likelihood Ratio. Click on "Include exponential parameter estimates" in the
Print section.
In the EMMEANS tab, choose FUNCTDENT as the categorical variable for which we
would like to have SPSS calculate the means of NUM_DIAGNOSTIC. When you have
arrowed FUNCTDENT into the box at the upper right of the window, select the
Contrast as Pairwise, to get comparisons of the number of diagnostic services for
each level of FUNCTDENT. Under Scale, choose Compute Means for Response (so
the results will be on the original scale).
When you've filled out everything, choose "Paste" to paste your commands, or "OK" to
run.
3
/EMMEANS TABLES=functdent SCALE=ORIGINAL COMPARE=functdent CONTRAST=PAIRWISE
PADJUST=LSD
/MISSING CLASSMISSING=EXCLUDE
/PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).
Model Information
N Percent
Excluded 6 .6%
N Percent
M 260 26.5%
2 376 38.3%
3 480 48.9%
4
Continuous Variable Information
Goodness of Fitb
Value df Value/df
Akaike's Information
3855.313
Criterion (AIC)
Bayesian Information
3889.533
Criterion (BIC)
a. The full log likelihood function is displayed and used in computing information criteria.
Omnibus Testa
Likelihood Ratio
Chi-Square df Sig.
338.681 6 .000
5
Tests of Model Effects
Type III
Likelihood Ratio
Source Chi-Square df Sig.
Parameter Estimates
(Intercept) . .
.980 .590 1.369 24.313 1 2.664 1.805 3.933
1987 000
[functdent=0] . .
-.678 -.796 -.561 128.532 1 .507 .451 .571
0598 000
[functdent=1] . .
.209 .107 .310 16.180 1 1.232 1.113 1.364
0519 000
[functdent=2] 0a . . . . . . 1 . .
[Sex=F] . .
-.148 -.244 -.053 9.212 1 .862 .783 .949
0488 002
[Sex=M] 0a . . . . . . 1 . .
[nursebeds=1.00 . .
-.042 -.174 .091 .382 1 .959 .840 1.095
] 0676 536
[nursebeds=2.00 . .
-.007 -.097 .082 .027 1 .993 .908 1.086
] 0457 870
[nursebeds=3.00
0a . . . . . . 1 . .
]
6
Parameter Estimates
BaseAge . .
.004 .000 .009 2.460 1 1.004 .999 1.009
0024 117
(Scale) 1b
Covariates appearing in the model are fixed at the following values: BaseAge=82.73
Pairwise Comparisons
Pairwise comparisons of estimated marginal means based on the original scale of dependent variable Num_Diagnostic
7
Overall Test Results
298.515 2 .000
The estimated annual number of diagnostic services for those participants who are
edentulous is 1.7, while it is 4.12 for those with < 20 teeth, and 3.34 for those with
>=20 teeth. There is a significant difference in the annual number of diagnostic
services required in Period 1 between each of the levels of functional dentition, after
controlling for the other covariates in the model.
The value of the deviance divided by its degrees of freedom and the Pearson chi-
square divided by its degress of freedom, 1.38 and 2.20, respectively, suggest that
there might be some overdispersion. We will next fit an overdispersed Poisson model,
using Proc Genmod. To do this, we can calculate the scale as the inverse of either the
Deviance/df or Pearson Chi-square/df. We choose to use the value of Pearson Chi-
square/df. To do this, we compute a new variable in our dataset:
Compute pscale=1/2.2033.
EXECUTE.
And now, we refit our model, using PSCALE as our scale weight. To do this, go to the
Response tab, and under Scale Weight, choose PSCALE as the Scale Weight Variable.
When the revised commands are now pasted, we see the following Model subcommand:
When the Scaleweight option is specified, the model estimates are first obtained by
setting the scale to 1.0, as for the Poisson distribution; thus the parameter estimates
are unchanged from the Poisson model. Then, the scale parameter is estimated by
either the square root of the Pearson chi-square/df or the square root of the
deviance chi-square/df. The standard errors and other statistics are adjusted
8
accordingly. For example, the standard errors of the parameter estimates are
divided by the new scale statistic, making the statistical tests more conservative.
The parameter estimates and EMMEANS output from this new model is shown below.
Note that the parameter estimates are the same as in the previous model fit, but the
standard errors have been increased, resulting in more conservative statistical tests.
9
Parameter Estimates
(Intercept) .980 .2950 .402 1.558 11.035 1 .001 2.664 1.494 4.750
[functdent=0] -.678 .0888 -.852 -.504 58.336 1 .000 .507 .426 .604
[functdent=1] .209 .0770 .058 .360 7.343 1 .007 1.232 1.059 1.433
[functdent=2] 0a . . . . . . 1 . .
[Sex=F] -.148 .0725 -.290 -.006 4.181 1 .041 .862 .748 .994
[Sex=M] 0a . . . . . . 1 . .
[nursebeds=1.00
-.042 .1003 -.238 .155 .173 1 .677 .959 .788 1.167
]
[nursebeds=2.00
-.007 .0678 -.140 .125 .012 1 .912 .993 .869 1.134
]
[nursebeds=3.00
0a . . . . . . 1 . .
]
BaseAge .004 .0036 -.003 .011 1.116 1 .291 1.004 .997 1.011
(Scale) 1b
10
Estimates
Pairwise Comparisons
Pairwise comparisons of estimated marginal means based on the original scale of dependent variable Num_Diagnostic
135.485 2 .000
11
We now refit the model, using a Negative Binomial distribution for the response
variable, to do this, go to the Type of Model tab, and select Negative Binomial with
Log ling. Be sure you go to the Response tab and remove the Scale Weight Variable.
The pasted resulting portion of the commands for the Model subcommand are shown
below:
***You need to change this syntax, as shown below (i.e., replace the (1) with (MLE)
after the NEGBIN portion of the syntax) to get the correct Maximum Likelihood
estimate of the Negative Binomial Dispersion Parameter:
Selected portions from the output from this Negative Binomial regression model fit
are shown below. Note that the deviance/df and Pearson chi-square/df are now closer
to 1.0, so this is an improvement over the original Poisson Model.
Model Information
12
Goodness of Fitb
Value df Value/df
Akaike's Information
3800.220
Criterion (AIC)
Bayesian Information
3839.328
Criterion (BIC)
a. The full log likelihood function is displayed and used in computing information
criteria.
Omnibus Testa
Likelihood Ratio
Chi-Square df Sig.
236.106 6 .000
13
Tests of Model Effects
Type III
Likelihood Ratio
Source Chi-Square df Sig.
14
Parameter Estimates
(Intercept) 1.009 .2363 .546 1.472 18.225 1 .000 2.742 1.726 4.358
[functdent=0] -.691 .0689 -.826 -.556 100.614 1 .000 .501 .438 .574
[functdent=1] .224 .0621 .103 .346 13.054 1 .000 1.252 1.108 1.414
[functdent=2] 0a . . . . . . 1 . .
[Sex=F] -.148 .0584 -.263 -.034 6.417 1 .011 .862 .769 .967
[Sex=M] 0a . . . . . . 1 . .
[nursebeds=1.00
-.059 .0795 -.215 .097 .546 1 .460 .943 .807 1.102
]
[nursebeds=2.00
-.010 .0543 -.116 .096 .034 1 .854 .990 .890 1.101
]
[nursebeds=3.00
0a . . . . . . 1 . .
]
BaseAge .004 .0029 -.002 .010 1.853 1 .173 1.004 .998 1.010
(Scale) 1b
(Negative
.145 .0237 .105 .200
binomial)
15
Estimates
Covariates appearing in the model are fixed at the following values: BaseAge=82.73
Pairwise Comparisons
Pairwise comparisons of estimated marginal means based on the original scale of dependent variable Num_Diagnostic
218.816 2 .000
16
There are some minor differences in the model estimates and standard errors for
this negative binomial model vs. the original Poisson model, but the model fit
statistics are better.
17