Logistic Regression: A Self-learning Text, Third Edition (Statistics in the Health Sciences)

(vip2019) #1

EXAMPLE (continued)


Datalines in events trials format
(n 5 609)
Group
(g) dg ng CAT AGEG ECG
1 17 274 0 0 0
2 15 122 0 1 0
3 7 59 0 0 1
4 5 32 0 1 1
518100
6 9 39 1 1 0
7 3 17 1 0 1
814581 1 1


proc logistic data¼evans2;
model cases/total¼cat ageg ecg/
scale¼none aggregate¼(cat
ageg ecg) lackfit;
output out¼pred p¼phat
predprob¼(individual); run;
proc print data¼pred; run;


The data layout used to fit both models in
events–trials format is now shown at the left.
Model EC1 is a no-interaction model involving
only the main effects CAT, AGEG, and ECG as
predictors. Model EC2 is a fully parameterized
model since there are eight model parameters
as well as eight covariate patterns, i.e.,pþ 1 ¼
8 ¼G.

Here, we provide the computer code using
SASs PROC LOGISTIC used to fit Model
EC1 and provide HL, deviance, and  2 lnL^C
statistics, as well as predicted risk values (i.e.,
“phat” in the code at the left) for each covariate
pattern.

EXAMPLE


Edited Output (Model EC1):
(Variables – CAT, AGE, ECG)

0.9474 4 0.9177
0.9544 4 0.9166
0.9793 4 0.9129


  • 2 Log L 418.181


1
2 0.11913 0.12295
3
4 0.16264 0.15625
5 0.11984 0.12500
6
7 0.16355 0.17647
8

No evidencethat Model EC1
has lack of fit

1 274 17 18.66 257 255.34
2 59 7 5.60 52 53.40
3 122 15 14.53 107 107.47
4 57 9 8.94 48 48.06
5 39 9 7.85 30 31.15
6 58 14 15.41 44 42.59

0.06810 0.06204
0.09497 0.11864

0.20128 0.23077
0.26574 0.24138

Edited output for Model EC1 is shown here.

The table of observed and expected cases
and noncases has divided the datainto Q¼ 6
percentile groupsrather than 10 deciles. The
number of covariate patterns isG¼8, so the
number of percentile groups allowable is less
than 10. Also, from thephatvalues provided
(below left), two pairs {0.11913, 0.11984} and
{0.16264, 0.16355} are essentially identical and
should not be separated into different groups.

SinceQ¼6, the df for the HL test isQ 2 ¼4.
The HL test statistic (0.9474) is not significant.
Thus, there is not enough evidence to indicate
that Model EC1 has lack of fit.

The output here also gives the Deviance
(0.9544) andPearson(0.9793) chi-square sta-
tistics as well as the log likelihood statistic
(418.181) for Model EC1.

Presentation: V. Examples of the HL Statistic 321
Free download pdf