EXAMPLE
G¼ 599 n(¼609):
Deviance nor Pearson not
approximatelyw^2
HL statistic approximatelyw^2
(can use HL for GOF test)
Edited Output (Model EC3):
(Variables – CAT, AGE, ECG, SMK, CHL, and HPT)
5.1028 8 0.7465
400.3938 592 1.0000
589.6446 592 0.5196
- 2 Log L 400.394
No evidence
Model EC3
has lack of fit
1 61 0 1.72 61 59.28
2 61 2 2.65 59 58.35
3 61 5 3.46 56 57.54
4 61 6 4.22 55 56.78
5 61 7 5.21 54 55.79
6 61 6 6.10 55 54.90
7 61 5 7.50 56 53.50
8 61 9 9.19 52 51.81
9 61 12 11.86 49 49.14
10 60 19 19.08 41 40.92
2 LogL¼DevSSðb^Þ
¼ 2 lnðL^SS;EC 3 =L^SS;maxÞ
since LogL^SS;max 0
SinceGnin both models, we therefore can-
not assume that the Deviance or Pearson sta-
tistics are approximately chi square. However,
we can use the Hosmer–Lemeshow (HL) statis-
tic to carry out a test for GOF.
On the left, we now show edited output for
Model EC3, which provides the HL information
as well as Deviance, Pearson, and2logL
statistics.
From the output for Model EC3, we see that the
predicted risks have been divided into (Q¼10)
deciles, with about 61 subjects in each decile.
Also, the observed and expected cases are
somewhat different within each decile, and
the observed and expected noncases are some-
what different.
The HL statistic of 5.1028 hasQ 2 ¼8 degrees
of freedom and is nonsignificant (P¼0.7465).
Thus, there is no evidence from this test that the
no-interaction Model EC3 has lack of fit.
Both the Deviance (400.3938) and Pearson
(589.6446) statistics are very different from
each other as well as from the HL statistic
(5.1028). This is not surprising since the Devi-
ance and Pearson statistics are not appropriate
for GOF testing here.
Note that since the log likelihood for the (SS)
saturated model is always zero, the log likeli-
hood (2 LogL) value of 400.394 is identical to
the Deviance value (i.e., DevSSð^bÞÞfor Model
EC3. We will use this value of2 LogLin an
LR statistic (below) that compares the no-inter-
action Model E3 to the interaction Model EC4.
324 9. Assessing Goodness of Fit for Logistic Regression