How can I concatenate ROC curve coordinates of different lengths?

1 view (last 30 days)
I am trying to get a 'null' ROC curve for a logistic regression model using Matlab R2012b. The general idea is to 1) shuffle my response variable (0 or 1) amongst the different measured combinations of predictors, 2) select the most parsimonious model using AIC procedure, 3) create a ROC curve for this 'dummy' analysis, 4) repeat 1000 times and compute confidence intervals for the 'null' ROC curve.
I am running into problems when trying to concatenate the X and Y values for the different ROC curves because the length of the vectors vary depending on how many/which independent variables are retained.
I tried playing around with the XVals option. The line [rocX,rocY,rocT,AUC] = perfcurve(success,pr,1, 'XVals', [0:0.01:1]);
should fix my problem if I follow the documentation (i.e. standardize the number of threshold values being evaluated) but it does not. The command does not seem to do anything.
I also tried interpolating each curve to get the same number of X Y coordinates using [rocX,rocY,rocT,AUC] = perfcurve(success,pr,1); Xvals=0:0.01:1; roc=interp1(rocX,rocY,Xvals);
and then concatenating the roc and Xvals vectors. This works well when the ROC curve is smooth, but I get an error message when the ROC curve looks like stairs (The grid vectors are not strictly monotonic increasing). Changing the interpolation methods does not fix it.
Any pointers or advice would be much appreciated
Thank you all.
David
  1 Comment
David
David on 11 Jul 2013
Nevermind... I figured it out, I needed to play with the 'UseNearest' option.
For future reference, this works:
[rocX,rocY,rocT,AUC] = perfcurve(success,pr,1,'TVals',[0:0.01:1],'UseNearest','off');

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!