簡體   English   中英

比較特定時間點的存活率

[英]Comparing survival at specific time points

我有以下生存數據

library(survival)
data(pbc)

#model to be plotted and analyzed, convert time to years
fit <- survfit(Surv(time/365.25, status) ~ edema, data = pbc)

#visualize overall survival Kaplan-Meier curve
plot(fit)

這是生成的 Kaplan-Meier 圖的樣子

在此處輸入圖片說明

我正在以這種方式進一步計算 1、2、3 年的生存率:

>     summary(fit,times=c(1,2,3))

Call: survfit(formula = Surv(time/365.25, status) ~ edema, data = pbc)

232 observations deleted due to missingness 
                edema=0 
 time n.risk n.event survival std.err lower 95% CI upper 95% CI
    1    126      12    0.913  0.0240        0.867        0.961
    2    112      12    0.825  0.0325        0.764        0.891
    3     80      26    0.627  0.0420        0.550        0.714

                edema=0.5 
 time n.risk n.event survival std.err lower 95% CI upper 95% CI
    1     22       7    0.759  0.0795        0.618        0.932
    2     17       5    0.586  0.0915        0.432        0.796
    3     11       4    0.448  0.0923        0.299        0.671

                edema=1 
 time n.risk n.event survival std.err lower 95% CI upper 95% CI
    1      8      11    0.421  0.1133       0.2485        0.713
    2      5       3    0.263  0.1010       0.1240        0.558
    3      3       2    0.158  0.0837       0.0559        0.446

如您所見,結果輸出顯示了不同edema水平之間的 95% 置信區間,但沒有實際的 p 值。 無論置信區間是否重疊,我仍然很清楚這些時間點的生存率是否有顯着差異,但我想要准確的 p 值。 我該怎么做?

您的問題是“不同類型水腫的 X 年生存率是否不同”。

例如,如果您對 3 年生存率感興趣; 您只需要關注曲線的那部分(隨訪的前 3 年),如圖所示。 3 年后仍然存活的患者的隨訪時間設置為 3 年(即本分析中的最長隨訪時間): pbc$time[pbc$time > 3*365.25] <- 3*365.25

使用“survival”包(您在分析中已經使用的相同包)中的coxph計算對數秩檢驗將為您提供 P 值,該值表明三組之間的三年生存率是否不同(在這個例子中非常重要)。 您還可以使用相同的模型來生成水腫與特定原因生存相關的 P 值和風險比。

最長隨訪 3 年的 KM 曲線

我認為以下代碼可以滿足您的需求:

library(survival)
data(pbc)

#model to be plotted and analyzed, convert time to years
fit <- survfit(Surv(time/365.25, status) ~ edema, data = pbc)

#visualize overall survival Kaplan-Meier curve
plot(fit)

threeYr <- summary(fit,times=3)

#difference in survival at 3 years between edema=0 and edemo=1 (for example) is
threeYr$surv[1] - threeYr$surv[3]
#the standard error of this is
diffSE <- sqrt(threeYr$std.err[3]^2 + threeYr$std.err[1]^2)
#a 95% CI for the diff is
threeYr$surv[1] - threeYr$surv[3] - 1.96 *diffSE
threeYr$surv[1] - threeYr$surv[3] + 1.96 *diffSE
#a z-test test statistic is
zStat <- (threeYr$surv[1] - threeYr$surv[3])/diffSE
#and a two-sided p-value testing that the diff. is 0 is
2*pnorm(abs(zStat), lower.tail=FALSE)

或者,可以通過基於估計的概率估計風險比或優勢比來進行比較,並在對數風險比或對數優勢比量表上執行推理/測試。 一般來說,我希望這會表現得更好(在測試規模和置信區間覆蓋率方面),因為在這些尺度上的正態近似比在風險差異尺度上更好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM