服务热线
178 0020 3020
install.packages("survival")
install.packages("survminer")
library(survival)
library(survminer)
library(ggplot2)
library(ggpubr)
fit=survfit(Surv(time,status)~sex,data=lung)
lung
ggsurvplot(fit, data=lung,surv.median.line ="hv",pval=TRUE,conf.int=TRUE,legend.labs=c("Male","Female"),legend.title="SEX",ncensor.plot=TRUE,risk.table=TRUE,risk.table.col="sex",palette=c("pink","grey"),title="R2-22")
附件