log-likelihoods from mnrfit; testing proportional-odds model

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?

 Accepted 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

3 Comments

Tom, thank you
Could I calculate AIC in the mnrfit?
Bests Ali
Dear Tom,
I'm afraid I can't make sense of your answer. Matlab R2019b help mnrfit doesn't seem to contain this example, in your code 'x' and 'pHatNom' are not defined.
Can you kindly explain again how to compute log-likelihood from the mnrfit function's dev output (maybe taking 'carbig' example from hte mnrfit help page)?
Many thanks,
Mike

Sign in to comment.

More Answers (0)

Asked:

on 13 Feb 2012

Commented:

on 4 Jun 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!