侵权投诉
搜索
更多>> 热门搜索:
订阅
纠错
加入自媒体

何使用Survminer包优雅的绘制生存曲线?

2020-12-31 09:18
科研菌
关注


# 颜色设置:palettes. ggsurvplot(fit, data = lung,           surv.median.line = "hv",legend.title = "sex",           legend.labs = c("Male", "Female"),           pval = TRUE,conf.int = TRUE,risk.table = TRUE,           tables.height = 0.2,tables.theme =theme_cleantable(),           palette = c("#E7B800", "#2E9FDF"))

# 同时改变font size, style and colorggsurvplot(fit, data = lung, main = "Survival curve",           font.main = c(16, "bold", "blue"),           font.x = c(14, "bold.italic", "red"),           font.y = c(14, "bold.italic", "grey"),           font.tickslab = c(12, "plain", "darkgreen"))

#接下来,我们将讲解如何在一张图片上绘制多个生存曲线,这里使用R内置数据colon(自变量更多)

#查看colon数据View(colon)

#我们选择自变量sex(性别)+ rx(治疗方式)+adhere(邻近器官)

#拟合多个生存曲线fit3 <- survfit( Surv(time, status) ~ sex + rx + adhere,data = colon )# 画多个生存曲线 ggsurvplot(fit3, data = colon,                     fun = "cumhaz", conf.int = TRUE,                     ggtheme = theme_bw())

#以上图形可以看出,图形复杂且杂乱,因此需要分割图片

# 分割开多个生存曲线 ggsurv<-ggsurvplot(fit3, data = colon,                    fun = "cumhaz", conf.int = TRUE,                    risk.table = TRUE, risk.table.col="strata",                    ggtheme = theme_bw())curv_facet <- ggsurv$plot + facet_grid(rx ~ adhere)curv_facet

<上一页  1  2  3  4  下一页>  余下全文
声明: 本文由入驻维科号的作者撰写,观点仅代表作者本人,不代表OFweek立场。如有侵权或其他问题,请联系举报。

发表评论

0条评论,0人参与

请输入评论内容...

请输入评论/评论长度6~500个字

您提交的评论过于频繁,请输入验证码继续

暂无评论

暂无评论

工控 猎头职位 更多
文章纠错
x
*文字标题:
*纠错内容:
联系邮箱:
*验 证 码:

粤公网安备 44030502002758号