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 日

0 投票

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 件のコメント

Libby
Libby 2012 年 2 月 14 日
Thanks!
Aliakbar
Aliakbar 2015 年 11 月 23 日
Tom, thank you
Could I calculate AIC in the mnrfit?
Bests Ali
michal.markun
michal.markun 2020 年 6 月 4 日
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 ExchangeDownloads についてさらに検索

質問済み:

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