フィルターのクリア

Computing likelihood ratio pseudo-R2

9 ビュー (過去 30 日間)
Andreas
Andreas 2014 年 1 月 17 日
編集済み: Arseny 2017 年 9 月 4 日
I wish to compute the likelihood ratio pseudo-R2 from a logistic regression using glmfit.
According to the Wikipedia definition it is defined as
R2 = (DevianceNull-DevianceModel)/(DevianceNull).
Does DevianceModel correspond to dev returned from glmfit?
[~, dev] = glmfit(X, Y, 'binomial');
In that case, is the pseudo-R2 computed as?
[~, devModel] = glmfit(X, Y, 'binomial');
[~, devNull] = glmfit(zeros(length(Y), 1), Y, 'binomial');
R2 = (DevNull-DevModel)/(DevNull);
Many thanks
  1 件のコメント
Andreas
Andreas 2014 年 1 月 20 日
Nobody?

サインインしてコメントする。

回答 (1 件)

Arseny
Arseny 2017 年 9 月 4 日
編集済み: Arseny 2017 年 9 月 4 日
It would be your code, but with
[~, devNull] = glmfit(X, Y(randperm(length(Y))), 'binomial');
Or better yet, this row repeated several times, and devNull estimation averaged over these several attempts.

Community Treasure Hunt

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

Start Hunting!

Translated by