05-15-2014 09:53 PM
I am interested in finding a cut-off value of a continuous variable in my dataset.
Has anyone performed ROC analyses in SAS to obtain a cut-off value.
After trying some variation in SAS code, I got the attached results, but I am not quite sure about how to interprete the results.
It would be helpful if you could help me with the code to obtain the criterion/cut-off value and the area under the curve.Is there any straihforward simple code/way to do this in SAS?
Below is the SAS code I tried:
ods graphics on;
proc logistic data=diabet.data plots(only)=(roc(id=obs) effect) descending;
model cadcat2=eatcm / scale=none
ods graphics off;/
I tried SPSS too, but for some reason i kept getting the following warning:
Text: 0,1 Command: ROC
An invalid numeric field has been found. The result has been set to the system-missing value.
Execution of this command stops.
Any help would be greatly appreciated.
Thank you very much!
05-16-2014 10:40 AM
Choosing a cutpoint depends on what criterion you want to use. The best tool for this is the CTABLE option in the MODEL statement. This option displays a table with statistics for each of a range of cutpoints such as the correct classification rate, false positive and negative rates, etc. If you want, you can change the cutpoints used in the table with the PPROB= option. For example, with this table you could find the cutpoint that maximizes the correct classification rate, or the cutpoint that satisfies your criteria for false positive and false negative rates.
05-16-2014 03:17 PM
This is helpful. But I wonder how would I know the cut-point value of that continuous variable and the are under the curve.
Can i find that using any other option in the SAS code?
05-16-2014 03:37 PM
You have to make a judgement about the relative importance for false positives and false negatives. Which are more costly to make? IF they are equally costly, then you can use Youden's J statistic = sensitivity + specificty -1 = true positive proportion + true negative proportion -1. Use the cutoff that gives the highest J. The necessary values are in the ctable that statdave told you about.
05-16-2014 03:39 PM
...and the area under the ROC curve is estimated with the c statistic that is found in the Association of Predict.... table in the output. Also, you should check out the ROC statement in the help file for more ROC related output.
05-16-2014 08:41 PM
Thanks for the response! I did calculate the Youden's J statistics but I am not sure how to find out the corresponding cut-off value of the "interest variable- EATCM" Below I am pasting the part of the SAS output and the last column is the Youden's J stat and the first column is the probability. The max value of Youden's J is 154.6 and it corresponds to the 0.12 probability. From this information, how would I know the cut-off value of the interest variable?
05-16-2014 09:14 PM
First of all, the formula is true positive PROPORTION + true negative PROPORTION -1. You used percentages, but kept the "1". This is not correct. If you work in percentages, then
J = true positive PERCENTAGE + true negative PERCENTAGE - 100.
Assuming that you get the maximum at p=0.12 (check this), this is what you do. You use the fitted logit equation from your output:
logit(.12) = -4.71 + 0.0231X,
where X is your predictor. This gives:
-1.99 = -4.71 + 0.0231X, or
X = (-1.99 + 4.71)/0.0231 = 117.6. This is your cut-off.
Looking at your fitted curve at the end of your output, this looks about right.
05-19-2014 03:16 PM
@ lvm: this is mighty helpful!. Thanks a lot! Based on the youden's J index and the above calcualtions (that you've provided), the cut-off value does match with the clinically relevant cut-off value, which I had used earlier in my analyes. The reviewers had asked for a statistical justification to substantiate the cut-off based on ROC analyses, and I am happy that I have it now.
Gretaly appreciate your time and help!
11-24-2015 04:47 PM
I am also trying to back calculate a particular conconcentration using Youden's Index. However, I have been using a different software package as I have a continuous dataset. Could you please explain how you derived the values -4.71 and 0.0231, i.e. what varables have been used in a regression. Is this something I could do manually by graphing respective variable in excel and getting a trend line and regression equation. I too tried to manually generate the value -1.99 and the closest I got was -1.7, is this a natural log or log to some base value? Thanks for any assistance you are able to provide.
07-10-2014 12:24 PM
I am facing a similar issue and found the above helpful. I have a couple of follow up questions if you don't mind (for both Ashwini_uci and lvm):
Also just to add a possible solution if not just looking for a single "best" cut point, I received this code from a SAS consultant who I was connected with when I contacted SAS Support directly:
If you have just a single X variable then you could solve for it. Something like this would work:
do i=1 to 20;
logit=-2 + 2*x1;
if ranuni(seed)>p then y=1; else y=0;
drop seed i p logit;
proc logistic data=test outest=parms(keep=intercept x1);
model y=x1/ outroc=out1;
if _n_=1 then set parms;
proc print data=cutpoints;
var _sensit_ _1MSPEC_ _prob_ x1_cut;
Principal Technical Support Statistician