stepwise logistic regression using statistics toolbox

4 ビュー (過去 30 日間)
Boyi Jiang 2015
Boyi Jiang 2015 2015 年 8 月 14 日
コメント済み: the cyclist 2015 年 8 月 15 日
The response y in "stepwiseglm" has to be one column vector?
I found that the response y in "glmfit" can be two column matrix with the first column indicating the number of successes for each observation and the second column indicating the number of trials for each observation.
My response y is in format [successes; num of trials] and I want to use "stepwiseglm". How can I do that? Thank you so much!
Boyi

採用された回答

the cyclist
the cyclist 2015 年 8 月 14 日
編集済み: the cyclist 2015 年 8 月 14 日
You can specify the response variable y as a two-column vector, just as you did in glmfit. You must also then specify a binomial distribution, by adding the name-value pair like this ...
stepwiseglm(...,'Distribution','Binomial')
This is mentioned in the documentation for stepwiseglm.
  2 件のコメント
Boyi Jiang 2015
Boyi Jiang 2015 2015 年 8 月 14 日
Thank you so much! One further question: once I obtained the model, how can I use "[X,Y] = perfcurve(labels,scores,posclass) " to create the ROC curve? Since the response has two colunms: [successes; num of trials]. How to create the "labels"?
the cyclist
the cyclist 2015 年 8 月 15 日
I don't know. You might want to post this as a new question, to get more visibility.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by