2010年1月17日 星期日

Cox 比例風險回歸 (Cox Proportional Hazards Model) 的應用

The prototype of hazard function:h(t,X) = h0(t) exp (b1X1 + b2X2 + b3X3 + ... + bkXk)
h0(t): baseline hazard function
t: time to event
X: covariates
b: coefficients
exp: exponential function

例子:加護病房病人產生黴菌尿後,有些接受治療有些不治療。經過一段時間後,他們的預後有沒有差別?換句話說,他們的死亡跟有沒有用藥到底有沒有關聯?

此例並非隨機雙盲試驗,我們無法只比較 Kaplan-Meier curves 來得到結論。用不用藥物受到病人的本身身體狀況,以及疾病嚴重度的影響。有沒有用藥又進一步受到時間因素的干擾:有些人來不及用藥,有些剛開始沒有用藥,後來因為狀況不好又把藥物加上去。 在這裡我們可以用 Cox proportional hazards model 來考慮這些干擾因素的影響,以評估藥物與病人預後(死亡)的相關性。


Cox porportianl hazards model 的特性 [1-3]:
1. 不需事先知道 ho(t) 這個 baseline hazard function,也不要求服從特定的機率分佈。因此它有 non-parametric model 的特性。
2. 解釋變數或共變數(covariates)的部份有 parametric model 的特性。所以有些人說 Cox 回歸屬於 semi-parametric models。
3. 解釋變數的風險(hazards)是一個定值,不隨著時間變化。亦即,符合比例風險假定(proportinal hazards assumption)。
4. 解釋變數可以是連續變項,類別變項或是有次序的變項。 


應用 Cox proportional hazards model 來做回歸我們必須注意[1]:
1. 研究樣本數要足夠,一般需要自變數個數的十倍以上。若研究得出的結果違背常理,則必須考慮到模型設計上面的缺陷,不一定是科學上的新發現。
2. 要符合比例風險假定 (proportional hazards assumption)。任意兩個個體在同一個變數的風險比 (risk ratio) 是一個定值,不隨著時間變化。不符合比例風險假定則可分層或是作 Cox regression with time-depedent covariates。以前面黴菌尿的例子,治療會受到時間因素的影響,因此必須作時間協變的 Cox regression。
3. covariates 若是連續變數,可考慮轉成類別變數再分析。比如說血球數目,回歸的時候單位是用顆來計算,所得到的結果意義就代表,血球數每增加或減少一個所帶來的風險變化。
4. covariates 若是沒有次序性的,例如居住地等等,則需加入 dull variables,以免造成解釋上的困難。
5. 變數的篩選需考慮:臨床上有意義的重要的變數要放入模型,無關的不擺進去,或是先作單變數分析再篩選等等。

判斷是否符合風險比例假定有幾個方法 [1-3]:
1. 圖形法(graphic methods)。
  • 直接比較 survival curves 是最直觀的方法之一。就在 SPSS 裡面直接作 Cox regression 把懷疑受時間影響的變數放進 Strata,covariates 不放,然後畫圖。如果圖形有明顯交錯就不符合風險比例假定。
  • Log-minus-log plots
  • Partial residual plots
2. Goodness-of-fit test。查不到怎麼實做。
3. Computational methods, like time-interaction test. 一個符合比例風險假定的 covariates,和時間交互作用後的變項,將其加入 Cox 回歸模型,其回歸係數應該很接近零(和 0 沒有顯著差異)[3]。若 covariate 對時間的交互作用項在 Cox 回歸模型中有統計意義,covariate 就不符合比例風險假定 [1]。

REFERENCES:
1. 生存分析。醫學統計學,第二十三章。人民衛生出版社 2005 年第一版。
2. Proportional hazards model. Available at: http://en.wikipedia.org/wiki/Proportional_hazards_models [Accessed January 16, 2010]
3. Cox regression. Available at: http://faculty.chass.ncsu.edu/garson/PA765/cox.htm [Accessed January 17, 2010]

2009年9月30日 星期三

布瓦松分佈與區間估計 (Poisson Distribution and Estimation of Confidence Interval)

Poisson Distribution 可視為二項式分佈 (Binomial Distribution) 的極限情形。亦即,當試驗次數 (n) 趨近無窮大,p 很小,但一段時間裏面 np 為一不大不小的定值時。從品質管理的角度,如:每日不良產品的數目,不良事件的發生數目等等,每週醫療照顧相關感染的發生次數等等,皆適用於布瓦松分佈。[1]

依從 Poisson 分布的群體,最佳的點估計即為平均值 u。當我們只做了一個單次的觀察,可利用卡方分佈 (Chi square Distribution) 與 Poisson 分布的關係,很快的求出對應的 95% 信賴區間估計 (exact confidence interval)。[2-4]

令 x 為單次的觀察結果 (發生次數),InvChiSqare (v,y) 函數代表自由度 v 的 Chi Sqare 分布下面積為 y 的機率分布對應的 Chi Sqare 值。則依從 Poisson 分布的 95 % 信賴區間上下限 (exact confidence interval; UL; LL) 與卡方分布有如下的關係:

LL = 1/2 * InvChiSqare (2x, 0.025)
UL = 1/2 * InvChiSqare (2x + 2, 0.975)

當觀察次數不止一次時 (observations = N),所有的觀察次數合 (n) 依從 Poisson 分布。其 95% 信賴區間上下限可如此表示:[5]

LL = 1/2 * InvChiSqare (2n, 0.025) / N
UL = 1/2 * InvChiSqare (2n + 2, 0.975) / N

References:
  1. Poisson 分布. Available at: http://episte.math.ntu.edu.tw/articles/sm/sm_16_07_1/index.html [Accessed Sep 30, 2009]
  2. Confidence intervals for the mean of a Poisson distribution. Available at: http://www.math.mcmaster.ca/peter/s743/poissonalpha.html [Accessed Sep 30, 2009]
  3. Poisson confidence interval. Available at: http://www.statsdirect.com/help/parametric_methods/pest.htm [Accessed Sep 30, 2009]
  4. An exact method for calculating a confidence interval of a poisson parameter. Mulder et al. American Journal of Epidemiology 117 (3): 337. Available at: http://aje.oxfordjournals.org/cgi/pdf_extract/117/3/377 [Accessed Sept 30, 2009]
  5. Estimating the mean of a Poisson population. Chapter 6.3. Available at Google Books [Accessed Sep 30, 2009]

2009年1月5日 星期一

GDIPLUS.DLL dependency of AdvStringGrid

This is an excerpt from the website of TMS Component suite
---
Q22: Users of older operating systems have an error message on application startup related to a missing gdiplus.dll

A22: Either redistribute the Microsoft GDIPLUS.DLL (explained in README.TXT) or remove the gdiplus.dll dependency by commenting the line {$DEFINE TMSGDIPLUS} in TMSDEFS.INC