HL_test {lbreg}R Documentation

Hosmer-Lemeshow Goodness of Fit Test

Description

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.

Usage

 HL_test(object, g = 10) 

Arguments

object

object of class 'lbreg'.

g

number of groups

Value

A list with elements

X2

HL statistic

pvalue

p-value for the test from Chi Squared with df = g-2

Author(s)

Bernardo B. Andrade

References

Hosmer D W, Lemeshow S 2000. Applied Logistic Regression. New York, USA: John Wiley and Sons.

See Also

lbreg

Examples

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)

[Package lbreg version 1.3 Index]