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 200Ties)#of subjects 6 ¼exactly
20 (¼n/Q) in all deciles
Must keep subjects with identical
values of^PðXiÞin the same decileStep 4: Form table of observed
and expected cases and
noncases
Deciles
of risk
1
2
3
10Oc3Oc2Oc1Onc3Onc10Onc2Onc1Ec3Ec10Ec2Ec1Enc3Enc10Enc2Enc1Oc10Obs.
casesObs. non
casesExp. non
casesExp.
casesObserved 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¼~
nqi¼ 1P^ð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
decileThe 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