服务热线
178 0020 3020
install.packages("survival")
install.packages("survminer")
library(survival)
library(survminer)
library(ggplot2)
library(ggpubr)
library(magrittr)
fit<- survfit(Surv(time, status) ~ sex, data = lung)
ggsurvplot(fit, data = lung,title="R2-39",
surv.median.line = "hv",
legend.title = "SEX",
legend.labs = c("Male", "Female"),
pval = TRUE,conf.int = TRUE,
conf.int.alpha=0.1,
risk.table = "abs_pct",
risk.table.title ="R2-39",
risk.table.col="sex",
risk.table.y.text.col=TRUE,risk.table.y.text=FALSE,
ncensor.plot=TRUE,
ncensor.plot.title="R2-39",
tables.height = 0.22,
break.time.by=200,
palette = c("red","blue"))
附件