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

(vip2019) #1

Step 3: FormQpercentile group-
ings.
Typically,Q¼10, i.e., deciles of
risk e.g.,n¼ 200


Decile No. of subjects
1  20
2  20
... ...
9  20
10  20
Total 200

Ties)#of subjects 6 ¼exactly
20 (¼n/Q) in all deciles
Must keep subjects with identical
values of^PðXiÞin the same decile

Step 4: Form table of observed
and expected cases and
noncases
Deciles
of risk
1
2
3


10

Oc3

Oc2

Oc1

Onc3

Onc10

Onc2

Onc1

Ec3

Ec10

Ec2

Ec1

Enc3

Enc10

Enc2

Enc1

Oc10

Obs.
cases

Obs. non
cases

Exp. non
cases

Exp.
cases

Observed cases and noncases:


Ocqcounts#of cases (Yi¼1) in
qth decile
Oncqcounts#of noncases
(Yi¼1) inqth decile


Note:Oncq¼nqOcq


Expected cases and noncases:


Ecq¼~


nq

i¼ 1

P^ðXiqÞandEncq¼nqEcq,

where
Xiq¼covariate values forith subj
inqth decile


At the third step, we divide the ordered pre-
dicted risks intoQ percentile groupings. The
typical grouping procedure involves Q¼ 10
deciles. Thus, if the sample size is 200, each
decile will contain approximately 20 subjects.
Henceforth, we will assume that Q¼10.

Note, however, because some subjects may
have identical predicted risks (i.e., ties), the
number of subjects per decile may vary some-
what to keep subjects with identical predicted
risks in the same decile.

At the fourth step, we form (typically using
a convenient computer program) the table,
shown at the left, that contains observed and
expected cases and noncases within each dec-
ile. In this table, the valuesOcq,Ecq,Oncq, and
Encq,q¼1, 2,..., 10 are defined as follows:
Ocq¼#of observed cases in theqth decile
Ecq¼#of expected cases in theqth decile
Oncq¼#of observed noncases in theqth
decile
Encq¼#of expected noncases in theqth
decile

The observed cases (Ocq) and noncases (Oncq)
in each decile are obtained by simply counting
the numbers of subjects in that decile who are
cases (i.e.,Yi¼1) and noncases (i.e.,Yi¼0),
respectively. Note that once we countOcq,we
can obtainOncqby subtraction fromnq, the
total number of subjects in theqth decile.

The expected cases (Ecq) in each decile are
obtained by summing the predicted risks
P^ðXiÞ for all subjects in that decile. The
expected number of noncases (Encq) are
obtained by subtraction fromnq.

Presentation: IV. The Hosmer–Lemeshow (HL) Statistic 319
Free download pdf