服务热线
178 0020 3020
setwd("F:\\Doctor\\R语言学习\\互助小组\\第6期作业")
install.packages("ggpubr")
install.packages("survminer")
library(survival)
library(survminer)
data<-lung
fit<- survfit(Surv(time, status) ~ sex, data,
conf.type = "log-log")
ggsurvplot(fit,data,pval = TRUE,conf.int = TRUE,conf.int.alpha = 0.2,
surv.median.line = "hv",
legend.labs = c("Male","Female"),legend.title = "SEX",
risk.table = TRUE,risk.table.col = "sex",
ncensor.plot = TRUE,
palette = c("lightcoral","steelblue"),title = "R2-20")
附件