Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The LOGISTIC Procedure

The Hosmer-Lemeshow Goodness-of-Fit Test

Sufficient replication within subpopulations is required to make the Pearson and deviance goodness-of-fit tests valid. When there are one or more continuous predictors in the model, the data are often too sparse to use these statistics. Hosmer and Lemeshow (1989) proposed a statistic that they show, through simulation, is distributed as chi-square when there is no replication in any of the subpopulations. This test is only available for binary response models.

First, the observations are sorted in increasing order of their estimated event probability. The event is the response level identified in the "Response Profiles" table as "Ordered Value 1." The observations are then divided into approximately ten groups according to the following scheme. Let N be the total number of subjects. Let M be the target number of subjects for each group given by

M = [0.1 x N + 0.5]
where [x] represents the integral value of x. If the single-trial syntax is used, blocks of subjects are formed of observations with identical values of the explanatory variables. Blocks of subjects are not divided when being placed into groups.

Suppose there are n1 subjects in the first block and n2 subjects in the second block. The first block of subjects is placed in the first group. Subjects in the second block are added to the first group if

n_1 \lt M  {and}  n_1 + [0.5 x n_2] \leq M
Otherwise, they are placed in the second group. In general, suppose subjects of the (j-1)th block have been placed in the kth group. Let c be the total number of subjects currently in the kth group. Subjects for the jth block (containing nj subjects) are also placed in the kth group if
c \lt M  {and}  c + [0.5 x n_j] \leq M
Otherwise, the nj subjects are put into the next group. In addition, if the number of subjects in the last group does not exceed [0.05 ×N] (half the target group size), the last two groups are collapsed to form only one group.

Note that the number of groups, g, may be smaller than 10 if there are fewer than 10 patterns of explanatory variables. There must be at least three groups in order for the Hosmer-Lemeshow statistic to be computed.

The Hosmer-Lemeshow goodness-of-fit statistic is obtained by calculating the Pearson chi-square statistic from the g table of observed and expected frequencies, where g is the number of groups. The statistic is written

\vspace{-.4in}
 \chi^2_{HL} =
 \sum^g_{i=1}
 \frac{(O_i - N_i {\bar{\pi}}_i)^2}
 {N_i {\bar{\pi}}_i (1 - {\bar{\pi}}_i)}

where Ni is the total frequency of subjects in the ith group, Oi is the total frequency of event outcomes in the ith group, and {\bar{\pi}}_i is the average estimated probability of an event outcome for the ith group. The Hosmer-Lemeshow statistic is then compared to a chi-square distribution with (g-n) degrees of freedom, where the value of n can be specified in the LACKFIT option in the MODEL statement. The default is n=2. Large values of \chi^2_{HL}(and small p-values) indicate a lack of fit of the model.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.