MerQuR+Statistics Glossary

Statistics Glossary → Hosmer-Lemeshow goodness-of-fit test

Hosmer-Lemeshow goodness-of-fit testconcept

A fit test for logistic (and probit) regression that groups observations by their predicted probabilities and compares observed and expected numbers of events in each group.

Observations are sorted by the model's predicted probability and usually split into 10 groups of equal size (deciles). In each group the observed number of events is compared with the sum of the predicted probabilities (the expected number of events), and the differences are added up in a chi-square statistic; with g groups the degrees of freedom are about g - 2. The null hypothesis is 'the model fits the data'; a small p value shows that the predicted probabilities depart from the actual rates in some range.

A large p value does not prove the model is good; it only says there is no evidence of poor fit. The result is sensitive to the number of groups and to how tied values are allocated, so different software can give different p values on the same data. In very large samples even trivial departures come out significant, while in small samples the test has little power. It should therefore be read together with a calibration plot and discrimination measures (AUC). For complex survey designs, the Archer-Lemeshow version, which accounts for the weights, is used.

An everyday example

A bank builds a model that predicts the probability of default on loan applications. In the riskiest decile the model expects 42 defaults out of 100 applications and 45 actually occur; in the lowest-risk decile 2 are expected and 3 observed. Because the differences stay small across all ten groups, Hosmer-Lemeshow gives p = 0.62, showing no sign of poor fit.

In MerQur

Available as the 'Hosmer-Lemeshow' output in logistic regression and the 'Hosmer-Lemeshow' option in probit regression; weighted logistic regression offers the design-based 'Archer-Lemeshow goodness-of-fit test'.

Analyses where this concept appears

Logistic RegressionWeighted Logistic Regression (Survey Logistic Regression)Probit Regression

Related concepts

Goodness-of-fit tests (Pearson X² and deviance)Pseudo-R² (McFadden, Cox-Snell, Nagelkerke)