performance_hosmer: Hosmer-Lemeshow goodness-of-fit test

View source: R/performance_hosmer.R

performance_hosmerR Documentation

Hosmer-Lemeshow goodness-of-fit test

Description

Check model quality of logistic regression models.

Usage

performance_hosmer(model, n_bins = 10)

Arguments

model

A glm-object with binomial-family.

n_bins

Numeric, the number of bins to divide the data.

Details

A well-fitting model shows no significant difference between the model and the observed data, i.e. the reported p-value should be greater than 0.05.

Value

An object of class hoslem_test with following values: chisq, the Hosmer-Lemeshow chi-squared statistic; df, degrees of freedom and p.value the p-value for the goodness-of-fit test.

References

Hosmer, D. W., and Lemeshow, S. (2000). Applied Logistic Regression. Hoboken, NJ, USA: John Wiley and Sons, Inc. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/0471722146")}

Examples

model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")
performance_hosmer(model)

performance documentation built on Nov. 2, 2023, 5:48 p.m.