From c353208702a96804a7326d9cea4d17195d254163 Mon Sep 17 00:00:00 2001 From: Jens Sauer Date: Sun, 17 Jan 2021 19:02:33 +0100 Subject: [PATCH] secmal/cmprsk: Change scaling to years --- secmal.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/secmal.R b/secmal.R index 26d2da2..08f20a9 100644 --- a/secmal.R +++ b/secmal.R @@ -77,9 +77,10 @@ sma_plot_secmal_haz_dx <- function() { # plot competing risk of SM sma_plot_secmal_cmprsk <- function() { - cpr <- cuminc(secmal$time_at_risk, secmal$time_at_risk_status) + cpr <- cuminc(secmal$time_at_risk / 365.25, secmal$time_at_risk_status) ggcompetingrisks(cpr[1], conf.int = TRUE, multiple_panels = FALSE, - legend = "none", title = "", ylim = c(0:1)) + legend = "none", title = "", ylim = c(0:1), + xlab = "Year") } # Calculate cumuative risk with ci from cuminc.