簡體   English   中英

在R版本3.3.2中繪制審查事件

[英]Plot censored events in R version 3.3.2

我正在嘗試生成KM曲線,並希望檢查的事件像往常一樣在圖表中顯示(如十字或等價的)。

我正在使用上面的R版本,並更新了軟件包“ survival”,“ KMsurv”和“ rms”。

我嘗試在某些網站上顯示代碼沒有成功。

來自http://www.visualcinnamon.com/2013/07/plotting-survival-analysis-results-in-r.html的示例

library(survival)
data(colon)
fit = survfit(Surv(time,status)~rx, data=colon)
plot(fit, xlab="Time", ylab="Survival Probability", main="Kaplan-Meier plot")

我的確生成了KM曲線,但審查事件並未以圖形方式表示。

我也嘗試過(使用rms包):

fit <- npsurv(Surv(time,status)~rx, data=colon)
survplot(fit)

沒事。 我想念什么?

PS:基數R中的mark.time有效,但是我特別感興趣累積概率圖(又名“倒置KM”),我認為在基數R中不容易做到這一點。使用參數使用rms超級容易: 'fun = function(x){1-x}'

我的猜測是,這三個調用中的一個(或多個)(在?points.survfit頁面中記錄,該頁面又從?plot.survfit頁面鏈接):

 plot(fit, xlab="Time", ylab="Haz Probability", main="Kaplan-Meier plot",
            fun="cumhaz")  # the cumulative Hazard is 1-Survival
 plot(fit, xlab="Time", ylab="Haz Probability", main="Kaplan-Meier plot",
           fun="cumhaz", conf.int=TRUE)
 plot(fit, xlab="Time", ylab="Haz Probability", main="Kaplan-Meier plot",
            fun="cumhaz", conf.int=TRUE, mark.time=TRUE) # censoring markers

最后一個產生:

在此處輸入圖片說明

暫無
暫無

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

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