Hosmer-Lemeshow Test

Tests the goodness of fit of a logistic regression model using groups of predicted probabilities.

Statusvalidated
Version1.0.0
Minitab equivalentStat > Regression > Binary Logistic Regression > Goodness-of-Fit Tests

Description

The Hosmer-Lemeshow test divides observations into G groups based on predicted probabilities and compares observed versus expected events and non-events per group using a χ² statistic. Under the null hypothesis of adequate model fit, the test statistic follows a χ² distribution with G − 2 degrees of freedom. A small p-value indicates poor model fit.

Formulas

C
Hosmer-Lemeshow test statistic: sum of squared deviations of observed and expected events (O_g, E_g) and non-events (O'_g, E'_g) across all G groups
H₀
Under the null hypothesis of adequate fit, C follows a χ² distribution with G − 2 degrees of freedom
Gruppen
Observations are sorted by predicted probability and divided into G approximately equal groups
Entscheidung
Reject H₀ if p < α — the model fits the data poorly

Assumptions

  • Binary response variable (0/1)
  • Probabilities are estimated from a fitted logistic model
  • Sufficient observations per group (recommended ≥ 5 expected per cell)
  • Groups are based on predicted probability quantiles

Limitations

  • Sensitive to number of groups G — results can vary significantly
  • Low power for small sample sizes
  • Groups with few observations may invalidate χ² approximation
  • Does not indicate direction of misfit — only whether fit is inadequate
  • Not applicable for continuous outcomes

References

  • Hosmer, D.W., Lemeshow, S., A Goodness-of-Fit Test for the Multiple Logistic Regression Model, Communications in Statistics, 1980
  • Hosmer, D.W., Lemeshow, S., Sturdivant, R.X., Applied Logistic Regression, 3rd Ed., Wiley, Ch. 5.2