文章预览
理论部分 代码实战 # 0. load packages---------------------------------------------------------------------- library(ggsurvfit) library(tidycmprsk) library(adjustedCurves) library(tidyverse) library(patchwork) library(gtsummary) library(survival) library(survminer) library(flextable) library(jskm) library(openxlsx) library(jstable) library(eoffice) library(msm) library(survRM2) 1.传统生存分析完整流 教程地址:https://www.danieldsjoberg.com/gtsummary/reference/tbl_survfit.html # 加载数据 lung lung %>% mutate( status = recode(status, `1` = 0, `2` = 1), sex = as.factor(sex) ) str(lung) ####生存曲线绘制#### fit # 拟合生存模型 ## 绘制生图形 p1 ggsurvplot(fit = fit, #生存分析模型 data = lung, #数据集 palette = "npg" , #色板 pval = T, #显示p值 confint = T, #显示置信区
………………………………