survival: Improve plots
Display a risk table, median survival line and adjust theme.
This commit is contained in:
parent
12ffcd4e38
commit
c0c890c78c
16
survival.R
16
survival.R
@ -17,7 +17,10 @@ surv_asct <- Surv(time = secmal$event_time_asct, event = secmal$event_status)
|
||||
sma_plot_surv_dx <- function() {
|
||||
ggsurvplot(survfit(surv_dx ~ 1), data = secmal, xscale = "d_y",
|
||||
title = "Survival after diagnosis",
|
||||
break.time.by = 5 * 365.25)
|
||||
break.time.by = 5 * 365.25,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw())
|
||||
}
|
||||
|
||||
# plot survival after diagnosis per sex
|
||||
@ -26,6 +29,9 @@ sma_plot_surv_dx_sex <- function() {
|
||||
xscale = "d_y", title = "Survival after diagnosis",
|
||||
legend.labs = c("Female", "Male"),
|
||||
break.time.by = 5 * 365.25,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw(),
|
||||
pval = TRUE)
|
||||
}
|
||||
|
||||
@ -33,7 +39,10 @@ sma_plot_surv_dx_sex <- function() {
|
||||
sma_plot_surv_asct <- function() {
|
||||
ggsurvplot(survfit(surv_asct ~ 1), data = secmal, xscale = "d_y",
|
||||
title = "Survival after transplantation",
|
||||
break.time.by = 5 * 365.25)
|
||||
break.time.by = 5 * 365.25,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw())
|
||||
}
|
||||
|
||||
# plot survival after transplantation per sex
|
||||
@ -42,6 +51,9 @@ sma_plot_surv_asct_sex <- function() {
|
||||
xscale = "d_y", title = "Survival after transplantation",
|
||||
legend.labs = c("Female", "Male"),
|
||||
break.time.by = 5 * 365.25,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw(),
|
||||
pval = TRUE)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user