Learn R Programming

LOGIT (version 1.3)

HLTest: Display Hosmer-Lemeshow statistic and table of probabilities following logistic regression using glm with binomial family.

Description

Provides a Hosmer-Lemeshow statistic and table following logistic regression.

Usage

HLTest(obj, g)

Arguments

obj
model name
g
number of groups

Value

list

Format

x
The function has two arguments: model name, number of groups

Details

HLTest is a post-estimation function for logistic regression, following the use of glm(). Usage displays a table of observed vs predicted groups and an overall H-L goodness-of-fit statistic.

References

Hilbe, J. M. (2015), Practical Guide to Logistic Regression, Chapman & Hall/CRC.

Bilder, C.R. and Loughlin, T.M. (2015), Analysis of Categorical Data with R, Chapman & Hall/CRC.

Hilbe, J. M. (2009), Logistic Regression Models, Chapman & Hall/CRC.

Hosmer, D.W., Lemeshow, S, and Sturdivant, R.X (2013), Applied Logistic Regression, 3rd ed, Wiley.

See Also

glm

Examples

Run this code
library(MASS)
library(LOGIT)
data(medpar)
mylogit <- glm( died ~  los + white + hmo, family=binomial, data=medpar)
grp10 <- HLTest(obj=mylogit, g=10)
cbind(grp10$observed, round(grp10$expect, digits = 1))
grp10

Run the code above in your browser using DataLab