使用SAS 9.2 繪製ROC曲線和比較
在2008年4月的時候,曾經寫過一篇 繪製ROC曲線和比較兩條ROC曲線下面積 的小文章,這篇是以MACRO來畫圖和比較,而在新版的SAS 9.2中已經可以於PROC LOGISTICS直接繪製高品質的ROC曲線(Receiver Operating Characteristic Curves, ROC Curves)。 在SAS 9.2中ODS GRAPHICS支援的程序增加許多,其中也包括PROC LOGISTICS。 先產生一筆虛擬的資料 data Age_data; input disease age bw@@; datalines; 0 50 65 0 39 61 0 21 70 0 61 67 0 30 55 0 35 63 0 25 52 0 41 66 0 43 52 0 36 54 0 37 46 0 25 61 0 41 53 0 62 55 0 28 70 0 33 68 1 52 45 1 49 61 1 47 42 1 62 31 1 55 67 1 70 61 1 75 55 1 77 52 1 81 68 1 64 53 1 62 41 1 39 57 1 61 51 1 61 55 1 57 49 1 79 67 ; run; 接下來就直接套用繪製的ROC曲線的語法 ods graphics on; proc logistic data=age_data plots(only)=(roc) rocoptions(id=prob) ; model disease (event='1')=age; run; ods graphics off; ods graphics on : 為宣告要繪製ods graphics的...