生存分析R语言绘图——ggsuvplot介绍及实例

Python013

生存分析R语言绘图——ggsuvplot介绍及实例,第1张

ggsurvplot(

fit, #生存分析结果

data = NULL, #a dataset used to fit survival curves

fun = NULL, # 定义生存曲线转换的任意函数。 经常使用的转换可以用字符参数指定:“event”绘制累积事件(f(y) = 1-y),“cumhaz”绘制累积风险函数(f(y) = -log(y)),“pct”以百分比表示生存概率。

color = NULL, #曲线颜色

palette = NULL, #颜色调色板,可选调色板有 "grey","npg","aaas","lancet","jco", "ucscgb","uchicago","simpsons"和"rickandmorty".

linetype = 1, #线条形状,可以用数值型向量1,2表示,也可以用字符串向量c("solid", "dashed").

conf.int = FALSE, #是否画出置信区间

pval = FALSE, #是否显示P值

pval.method = FALSE, #是否添加计算P值得方法得文本,前提是pval = TRUE

test.for.trend = FALSE, #默认是F,如果TURE,返回trend Pvalues检验。 趋势检验旨在检测生存曲线的有序差异。 也就是说,至少对一个群体来说。 只有组数为>2时,才能进行趋势测试。

surv.median.line = "none", #画一条水平或者垂直得生存中位值线,允许的值有c("none", "hv", "h", "v"). v: 垂直vertical, h:水平horizontal.

risk.table = FALSE, #是否显示风险table。其他值有absolute" or "percentage",显示绝对数值/百分比;参数"abs_pct" ,百分比以及绝对数值都显示

cumevents = FALSE, # logical value specifying whether to show or not the table of the cumulative number of events.

cumcensor = FALSE, #logical value specifying whether to show or not the table of the cumulative number of censoring.

tables.height = 0.25, #设置table得高度,取值范围0-1

group.by = NULL, #包含分组变量名称得字符串向量。长度<=2

facet.by = NULL, #一个字符向量,包含将生存曲线分成多个面板的分组变量的名称。

add.all = FALSE, #一个逻辑值。 如果为TRUE,则在主图中添加合并患者(null model)的生存曲线。

combine = FALSE, # a logical value. If TRUE, combine a list survfit objects on the same plot.

ggtheme = theme_survminer(), #主题名称

tables.theme = ggtheme, #主题名称,默认是theme_survminer.

... #后面描述的参数和其他参数将被传递给ggplot2 geom_*()函数,如linetype, size, ii)或ggpar()函数来定制图形。 看到的细节部分

)

r语言生存分析加入矫正因子是通过R语言。根据查询相关资料信息显示:R语言使用survival包的Surv函数创建生存对象,函数可以十分容易地完成生存曲线的校正,相应假设检验的结果也可以通过设置相关参数进行获取。