DHARMa
DHARMa copied to clipboard
Randomized quantile residuals for ordinal models
I confused discussions I had with @florianhartig on Twitter and put this into wrong issue, when a new one would have been appropriate.
I think this is sort of the same approach as DHARMa uses? (The notation is a bit tricky to follow) https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6133273
Anyway, I have found a dataset where the assumption of proportional odds is clearly violated. ordwarm2.dta from https://www3.nd.edu/~rwilliam/gologit2/ (with warm as response variable)
After some struggle I managed to create randomized quantile residuals with mgcv::ocat, but I can't figure out any clear way to distinguish predictors that violate the assumption. Although one way might be to plot residuals vs. predictor and facet_wrap the response categories and look at the extreme response categories to see whether the distributions deviates over the domain of the predictor.
One example of how this might look: (although I am uncertain whether this is a way that would show violation of the assumption)
Non-violated (according to Brant test):
Violated (according to Brant test):
Any ideas?
Coming back to this a couple of years later. This function creates randomized quantile residuals for the ocat family in mgcv, i.e. ordered factor model. I think it is an ordered logit model. https://gist.github.com/StaffanBetner/6241c5b816a8a78b20bd300743b3a66d
Thanks for this! It's on my list of to-do-things to look at multinomial / ordinal models, I just can't say how soon this will be!