全方位的耳鼻喉科就醫管道

2016年5月21日 星期六

如何在SPSS裡執行Harrel C statistics與Akaike Information Criterion(AIC)?

在生物研究常需要建立模型,但眾多變數的組合中哪一個模型是最好的呢?常用的方法包含使用Linear trend χ2 、Akaike Information Criterion或Harrel C statistics。



先介紹如何在SPSS中執行Harrel C statistics:
1. 下載Harrel C statistics.sps檔案,打開他
2. 在SPSS內先開啟cox regression,設定畫面中選"save"頁面,勾選最右邊的X*Beta
3. 執行好變數分析,資料理會多出一個變數,預設叫"XBE_1 "
4. 進到Harrel C statistics.sps開啟的Syntax裡,確認最後三行的time,status,pred各自對應到正確的
項目,一般time是對應到(存活)日期,status是對應到censor(存活狀況), pred就是剛剛cox regression出來的XBE_1,執行後可以得到Harrell's C statistic 和Somers' D.

Harrel C statistics.sps 分享連結
https://dl.dropboxusercontent.com/u/12719319/Harrel%20C%20statistics.sps



另外Akaike Information Criterion的部分,SPSS不容易直接得到答案,但經過簡單的算是其實一下就可以得到。首先了解AIC的定義就是AIC= 2k−2loglik。其中k就是degree of freedom,也就是變數的項目數-1,而−2loglik就是"-2 Log Likelihood",基本上用cox regression就可以輕鬆取得所有數字。

1. 執行COX regression,通常是一個類別變數做Covariate,要到"Categorial..."頁面設定好類別變數屬性,不然自由度會出錯,執行。
2. 在Omnibus Tests of Model Coefficients可以找到-2 Log Likelihood(通常是第一項),在第三項可以找到df(自由度)。
3. 接著,就計算"-2 Log Likelihood"的數值加上2*df(自由度)。舉例-2 Log Likelihood是1883,df是3,那麼AIC就是1883+2*3=1889。

參考資料:
http://www-01.ibm.com/support/docview.wss?uid=swg21478383
http://stats.stackexchange.com/questions/134551/aic-or-bic-for-model-selection-in-cox-regression-spss
Share:

1 則留言:

  1. Do you realize there is a 12 word phrase you can communicate to your partner... that will induce intense emotions of love and impulsive appeal to you deep within his heart?

    Because hidden in these 12 words is a "secret signal" that fuels a man's impulse to love, treasure and protect you with his entire heart...

    12 Words That Trigger A Man's Desire Response

    This impulse is so hardwired into a man's brain that it will drive him to work harder than ever before to to be the best lover he can be.

    Matter-of-fact, fueling this all-powerful impulse is so binding to getting the best ever relationship with your man that the second you send your man one of the "Secret Signals"...

    ...You'll soon find him open his soul and heart to you in such a way he's never expressed before and he will see you as the only woman in the world who has ever truly attracted him.

    回覆刪除

精選文章

過敏性鼻炎是否能根治?

在門診中,健祐醫師常遇到一類病患,明明是初診,卻有10幾年的病史,也常有"從出生就這樣"的敘述,小朋友最擔心一直吃藥會不會有副作用,年輕人覺得得了一個永遠不會好的病很困擾,中年人大多看開了拿拿藥也算有治療了。但只要細問,大家都會有一個共通的疑惑:過敏性鼻炎,...

總網頁瀏覽量