A modified Hosmer-Lemeshow goodness-of-fit test for asymmetric links: second-order power and robustness
Abstract
The Hosmer-Lemeshow test is the routine check of fit for logistic regression, yet it is weak against a wrong link, and the directed tests that are stronger lose their level when a single covariate is recorded in error. We apply Farrington's correction to its risk groups, which removes the single-record terms of the statistic and keeps the within-group products of residuals. The result is the score test for records of similar fitted risk sharing a miscalibration: locally most powerful against a smooth misfit in either direction, and as robust to gross errors as the Hosmer-Lemeshow test. One alignment functional, mapped in advance for asymmetric links, decides when it is more powerful than the Hosmer-Lemeshow test, at second order with ten groups and at first order with many. For the many groups of large samples, normal limits for both statistics correct the chi-squared reference of the widely used grouping rule of Paul and colleagues, under which the Hosmer-Lemeshow test reached a size of 12% or lost all its power, and they explain why that rule hid a clear misfit in 8873 SUPPORT patients that groups of 25 records detected. In pre-registered simulations, one gross covariate error in a thousand records raised the false-alarm rates of Stukel's, the cubic calibration and the GiViTI tests to 25-39%, while the risk-grouped tests stayed near 5%; among these, the corrected test was the most powerful in all 34 settings with negative alignment and a visible difference. The test is in the R package ebrahim.gof.
Related
- Shrinkage invalidates the Hosmer-Lemeshow test: goodness of fit for penalized logistic regression, with an application to glaucoma diagnosis
- Data-Matrix-Based Overall Goodness-of-Fit Testing for Confirmatory Factor Analysis: In-Sample Prediction Error for Observed Variables
- Kernelized Stein Discrepancy for Goodness-of-Fit Tests and Stein Sampling in R
- A goodness of fit approach to select the optimal visit sequence for nonparametric data synthesis
- Goodness-of-fit for distributions on metric spaces
BibTeX
@misc{ebrahim2026modified,
title = {{A modified Hosmer-Lemeshow goodness-of-fit test for asymmetric links: second-order power and robustness}},
author = {Ebrahim Khaled Ebrahim and Ibrahim Galal Khattab and Ahmed El-Kotory},
howpublished = {arXiv},
year = {2026},
month = oct,
doi = {10.48550/arxiv.2607.15454},
eprint = {2607.15454},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2607.15454},
}
RIS
TY - UNPB
TI - A modified Hosmer-Lemeshow goodness-of-fit test for asymmetric links: second-order power and robustness
AU - Ebrahim Khaled Ebrahim
AU - Ibrahim Galal Khattab
AU - Ahmed El-Kotory
PY - 2026
DA - 2026/10/04
PB - arXiv
DO - 10.48550/arxiv.2607.15454
UR - https://arxiv.org/abs/2607.15454
AB - The Hosmer-Lemeshow test is the routine check of fit for logistic regression, yet it is weak against a wrong link, and the directed tests that are stronger lose their level when a single covariate is recorded in error. We apply Farrington's correction to its risk groups, which removes the single-record terms of the statistic and keeps the within-group products of residuals. The result is the score test for records of similar fitted risk sharing a miscalibration: locally most powerful against a smooth misfit in either direction, and as robust to gross errors as the Hosmer-Lemeshow test. One alignment functional, mapped in advance for asymmetric links, decides when it is more powerful than the Hosmer-Lemeshow test, at second order with ten groups and at first order with many. For the many groups of large samples, normal limits for both statistics correct the chi-squared reference of the widely used grouping rule of Paul and colleagues, under which the Hosmer-Lemeshow test reached a size of 12% or lost all its power, and they explain why that rule hid a clear misfit in 8873 SUPPORT patients that groups of 25 records detected. In pre-registered simulations, one gross covariate error in a thousand records raised the false-alarm rates of Stukel's, the cubic calibration and the GiViTI tests to 25-39%, while the risk-grouped tests stayed near 5%; among these, the corrected test was the most powerful in all 34 settings with negative alignment and a visible difference. The test is in the R package ebrahim.gof.
ER -