The Lipsitz test is a goodness of fit test for ordinal response logistic regression models. It involves binning the observed data into equally sized g
groups based on an ordinal response score. This score is computed by summing the predicted probabilities of each subject for each outcome level multiplied by equally spaced integer weights. The user can specify the number of groups by assigning an integer value to g
, which is 10 by default.
Given this partitioning of the data, dummy variables, I
, are derived such that, for each group, I = 1
if the subject is in region g
and I = 0
if not. The model is then re-fit with these dummy variables. If the model has good fit, then the coefficients for all these dummy variables simultaneously = 0. Lipsitz et al (1996) suggest that likelihood ratio, Wald or score tests can be used; lipsitz.test
just uses the likelihood ratio test with g-1
degrees of freedom.
Note that the outcome variable MUST be converted to a factor before running the model. Using as.factor()
within the model function will cause an error because of the way in which lipsitz.test
uses the update()
function to re-fit the model.
It is recommended (Fagerland and Hosmer, 2016) that the Lipsitz test be run alongside the ordinal Hosmer-Lemeshow test (logitgof
) and the Pulkstenis-Robinson tests (pulkrob.chisq
and pulkrob.deviance
).