The Hosmer-Lemeshow test is a statistical test for goodness of fit for logistic regression models. According to ?hoslem.test
, it deals only with binary logistic regression. However, I wonder if this test can be used to a ordered logit model which has more than 2 levels for the dependent variable.
The ordered logit model is also known as the proportional odds model, or a cumulative logit model. And I use the "Ordinal" package. Thanks a lot.
Best Answer
Update 28 July: the below has now been pushed to CRAN in the
generalhoslem
package along with the Lipsitz and Pulkstenis-Robinson tests.Fagerland and Hosmer discuss a generalisation of the Hosmer-Lemeshow test and two other approaches (the Lipsitz test and Pulkstenis-Robinson tests) in A goodness-of-fit test for the proportional odds regression model 2013 Stat Med and in Tests for goodness of fit in ordinal logistic regression models (2016) Journal of Statistical Computing and Simulation.
I haven't checked properly yet, but as far as I know, they haven't been implemented in R. If that turns out to be the case, I plan to add them to the
generalhoslem
package.EDIT: it's probably also worth pointing out Fagerland and Hosmer's recommendation that
ANOTHER EDIT: I didn't realise this straight away but the only difference between the multinomial version of the Hosmer-Lemeshow test and the ordinal version is in the degrees of freedom. Strictly speaking, the test for ordinal response models requires sorting the observations by a weighted ordinal 'response score' but they show in the 2012 article above that that is equivalent to binning the observations in the same way as in the multinomial case.
I haven't properly tested it but the the
logitgof
function on my github page should now do the trick: https://github.com/matthewjay15/generalhoslem-v1.1.0/blob/1.2.0.9000/logitgof.R Note that if you examine the observed and expected tables produced by this function, then the columns may not be in the right order (they will be alphabetical). This shouldn't make any difference to the test statistic, though, as they will correspond to each other.An example using the
ordinal
andMASS
packages: