#######################KM曲线
rm(list = ls()) #清理环境
library(survival)
library(survminer)
df = read.csv("../rawdata/xxx.csv",row.names = 1)
# 1.0 sex categorica
fit_stage = survfit(Surv(time = survival_time,event = survival_state)~T_stage,
data=df)
# about the argument of ggsurvplot , please see http://www.sci666.net/55393.html
ggsurvplot(fit_stage,
pval = T, # P-value
conf.int = F, # confidence interval
risk.table = T, # the table below the plot
palette = "npg", # change the color
legend = c(0.8,0.8), # the possion of legend
legend.title = "T_stage", # the title of legend
legend.labs = c("1","2","3","4"), # the label of legend 数量需与T_stage一致
xlab = "Follow up time (months)" # the label of x-axis
)
KM曲线
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
禁止转载,如需转载请通过简信或评论联系作者。
推荐阅读更多精彩内容
- 生存分析作为分析疾病/癌症预后的出镜频率超高的分析手段,而其结果展示的KM曲线也必须拥有姓名和颜值! 生存分析相关...
- 欢迎大家关注我的公众号:一只勤奋的科研喵[http://mp.weixin.qq.com/mp/homepage?...
- SAS day 25: Proc Lifetest 1 What are the foundations for ...
- 测序上游分析系列: mRNA-seq转录组二代测序从raw reads到表达矩阵:上中游分析pipelinemiR...
- 中国目前拥有世界上最大最快的高速铁路网,高铁列车运行速度不断提升,高铁已成为大家商务旅行和节假日外出旅游的首选。但...