Learn R Programming

blm (version 2011.2.0)

hosmerlem: Hosmer-Lemeshow goodness-of-fit for binary data model

Description

Computes the chi-squared statistic based on groups for a regression analysis on a binary outcome. The observations are gouped according to the ranked order of the projected risks.

Usage

hosmerlem(y,predicted,groups=10,plot=FALSE,risk.labels=TRUE,sig=3,...)

Arguments

y
observed cases
predicted
predicted values
groups
scalar number of groups to bin for the observed - expected deviations
plot
logical whether plot of observed and expected counts should be returned
risk.labels
logical whether labels of midpoint of risk deciles should be included
sig
scalar value for rounding risk labels
...
further arguments to text to handle rendering of risk labels

Value

  • List of chisq, p.value, observed counts O, expected counts E, table group showing the quantile groupings.

See Also

glm

Examples

Run this code
data(grad)

fit <- blm(admit~gpa+gre,data=grad)

hosmerlem(grad$admit,predict(fit))

Run the code above in your browser using DataLab