简体   繁体   English

使用R中的survminer软件包(ggsurvplot)更改审查事件的形状

[英]Changing the shape of Censored Events using the survminer package (ggsurvplot) in R

i'm using the survminer package to create a Kaplan-Meier-Curve in R, which is working pretty well: 我正在使用survminer软件包在R中创建Kaplan-Meier-Curve,效果很好:

plotUICC=survfit(Surv(as.numeric(myData$eventtime),event=myData$eventtype)~myData$UICC, data = myData)

ggsurvplot(plotUICC,data=myData, risk.table = FALSE,pval = TRUE,conf.int = FALSE,legend.labs = c("UICC I", "UICC II"),legend = c(0.25, 0.26),legend.title = "",xlab = "Time in Months"))

Kaplan Meier Curve created with the Cod above 用上面的鳕鱼创建的Kaplan Meier曲线

I would like to change the "+" as censored event and use an simple "|" 我想将“ +”更改为受检查事件,并使用简单的“ |” instead. 代替。 Unfortunately neither help(ggsurvplot) nor google could help me. 不幸的是,help(ggsurvplot)和Google都无法帮助我。


These are the loaded packeges: 这些是已加载的软件包:

    other attached packages:
[1] ggthemes_3.4.0  survminer_0.3.1 ggpubr_0.1.2    ggplot2_2.2.1   survival_2.40-1
[6] readxl_0.1.1    gridExtra_2.2.1

A minimal working example is the following: 下面是一个最小的工作示例:

library(survminer)
library(survival)
fit <- survfit(Surv(time, status) ~ sex, data = lung)
p1 <- ggsurvplot(fit, data = lung)

Ideally, one would like to change the shape of the censors eg like so: 理想情况下,您希望更改检查器的形状,例如:

p2 <- ggsurvplot(fit, data = lung, censor.shape=124)

I have found no way to do this with the original survminer package. 我没有办法用原始的survminer软件包来做到这一点。 In a fork of survminer , I have implemented this behaviour, so that the following plot is produced: 在survminer的分支中,我实现了此行为,因此产生了以下图:

在此处输入图片说明

Acceptable values for censor.shape can be found here: http://sape.inf.usi.ch/quick-reference/ggplot2/shape 可以在此处找到censor.shape的可接受值: http ://sape.inf.usi.ch/quick-reference/ggplot2/shape

I haven't tested this thoroughly, but this extension is already very useful for me. 我尚未对此进行全面测试,但是此扩展名对我已经非常有用。 The "+" censors have bothered me for some time... “ +”审查员困扰了我一段时间。

Edit: This suggestion was now merged, the development version of ggsurvplot now accepts censor.shape and censor.size arguments: 编辑:此建议现已合并,ggsurvplot的开发版本现在接受censor.shape和censor.size参数:

ggsurvplot(fit, data = lung, censor.shape="|", censor.size = 4)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM