MATLAB: Log-likelihoods from mnrfit; testing proportional-odds model

devlog-likelihoodsMATLABmnrfitStatistics and Machine Learning Toolbox

I am attempting to test the proportional-odds assumption for the proportional-odds model of ordinal logistic regression (per Hosmer & Lemeshow 2000, p. 303-304). Essentially, I calculate a G statistic for the log-likelihood for the proportional-odds model to the log-likelihood from the baseline logit model.
My question, then, is how does one obtain the log-likelihood from mnrfit? From looking at the code, it appears that the output 'dev' is calculated from the deviance residuals, which matches a definition for deviance in Hosmer & Lemeshow (p. 146). However, Hosmer & Lemeshow also define deviance (p. 13) as -2*ln[(likelihood of fitted model)/(likelihood of saturated model)]. Is this also true of the 'dev' output of mnrfit?

Best Answer

You are correct about the "dev" output. Here's an illustration using the "help mnrfit" example. I can calculate the binomial log likelihood using the fitted probabilities from the model, and again using the sample proportions, and see that -2 times their difference matches the deviance:
>> xx = linspace(-4,4)';
>> Y = [1 11 13; 2 9 14; 6 14 5; 5 10 10; 5 14 6; 7 13 5; 8 11 6];
>> [betaHatNom,dev] = mnrfit(x,Y,'model','nominal','interactions','on'); dev
dev =
8.4767
>> -2*(sum(sum(Y.*log(pHatNom))) - sum(sum(Y.*log(Y/25))))
ans =
8.4767