[英]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.