paper

A modified Hosmer-Lemeshow goodness-of-fit test for asymmetric links: second-order power and robustness

arXiv:2607.15454

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.

arXiv comment27 pages, 6 figures, 3 tables; proofs and Tables S1-S18 in the ancillary file anc/ESM_1.pdf. Replaces the earlier version with new theory, pre-registered simulations and a new title. Code and results: https://doi.org/10.5281/zenodo.23131206. R package ebrahim.gof on CRAN