You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a specific issue just for Hosmer-Lemeshow, I opened several more general issues
R package generalhoslem has three tests compared in the Hosmer et al articles https://rdrr.io/cran/generalhoslem/man/logitgof.html
However: "Finally, it has been observed that the results from this implementation of the binary and ordinal Hosmer-Lemeshow tests and the Lipsitz test are slightly different from the Stata implementations. It is not not yet clear why this is but is under investigation." (quote from Details docstring)
for OrderedModel I get similar results to theirs but not the same, eg. my chi2=21.34, theirs is chi2=20.95, both at df=17.
similar to difference in my default to Stata: differences in binsizes in groups, e.g. groups are not exactly the same.
I haven't tried Stata for this yet. (example from unit test for OrderedModel using UCLA data)
WIP for #7094
update: I checked with Stata, chi2=21.504 slightly different from mine
The problem is not the groupsizes because all groups have the same size (nobs is multiple of number of groups)
Problem is in ties: there are 180 out of 400 ties in sort_var (average probability with score np.arange(1, k+1).
The split into groups depends on the sort algorithm.
If I use kind="stable" in argsort, then I get the same chi2 as in R generalhoslem. None of the numpy sorting algorithm replicates the Stata results.
Activity
ENH/TST: hosmer lemeshow, add sort_method, unit test for OrderedResul…
josef-pkt commentedon Oct 12, 2020
Hosmer-Lemeshow for OrderedModel
code to compute it, but no convenience function or method yet:
(from unit test in #7094 )
josef-pkt commentedon Oct 23, 2020
HL test for survey data
Archer, Kellie J., and Stanley Lemeshow. 2006. “Goodness-of-Fit Test for a Logistic Regression Model Fitted Using Survey Sample Data.” The Stata Journal 6 (1): 97–105. https://doi.org/10.1177/1536867X0600600106.
josef-pkt commentedon Jul 21, 2021
#7094 merged PR added hosmer lemeshow for Binary, Multinomial and OrderedModel
with comments on background and other packages