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?

 채택된 답변

Tom Lane
Tom Lane 2012년 2월 13일
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

Thanks!
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

질문:

2012년 2월 13일

댓글:

2020년 6월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by