HL_test {lbreg} | R Documentation |
The HL decile-of-risk test. Validity of the test assumes that the number of covariate patterns is close to the number of observations which is violated when many observations have the same covariate pattern and several ties will impact the required ordering and grouping (by deciles) of observations. This is less likely when there is at least one continuous covariate. Not valid for grouped data.
HL_test(object, g = 10)
object |
object of class 'lbreg'. |
g |
number of groups |
A list with elements
X2 |
HL statistic |
pvalue |
p-value for the test from Chi Squared with df = g-2 |
Bernardo B. Andrade
Hosmer D W, Lemeshow S 2000. Applied Logistic Regression. New York, USA: John Wiley and Sons.
require(lbreg)
# data preparation
data(PCS)
w <- PCS
w <- w[,-1]
w$race <- factor(w$race)
w$dpros <- factor(w$dpros)
w$dcaps <- factor(w$dcaps)
fm <- lbreg(tumor ~ ., data=w)
HL_test(fm)