使用survminer包(ggsurvplot)我使用的survminer包以創建的Kaplan-Meier-曲線中的R,這是相當不錯的截尾活動的形狀:改變中的R
plotUICC=survfit(Surv(as.numeric(myData$eventtime),event=myData$eventtype)~myData$UICC, data = myData)
ggsurvplot(plotUICC,data=myData, risk.table = FALSE,pval = TRUE,conf.int = FALSE,legend.labs = c("UICC I", "UICC II"),legend = c(0.25, 0.26),legend.title = "",xlab = "Time in Months"))
Kaplan Meier Curve created with the Cod above
我想將「+」更改爲審查事件,並使用簡單的「|」代替。不幸的是,無論是幫助(ggsurvplot)還是谷歌都無法幫助我。
這些是加載packeges:
other attached packages:
[1] ggthemes_3.4.0 survminer_0.3.1 ggpubr_0.1.2 ggplot2_2.2.1 survival_2.40-1
[6] readxl_0.1.1 gridExtra_2.2.1
可以展開通過提供一個最小工作示例您的問題(http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? – CMichael