diff --git a/secmal.R b/secmal.R index 1b021c7..e2159fe 100644 --- a/secmal.R +++ b/secmal.R @@ -75,6 +75,13 @@ sma_plot_secmal_haz_dx <- function() { ggtheme = theme_bw()) } +# plot competing risk of SM +sma_plot_secmal_cmprsk <- function() { + cpr <- cuminc(secmal$time_at_risk, secmal$time_at_risk_status) + ggcompetingrisks(cpr[1], conf.int = TRUE, multiple_panels = FALSE, + legend = "none", title = "", ylim = c(0:1)) +} + # Write secondary malignancy plots to files sma_plot_file_secmal <- function() { sma_plot_file("secmal_event.png", png, sma_plot_secmal_event) diff --git a/utils.R b/utils.R index a5a54cd..1658360 100644 --- a/utils.R +++ b/utils.R @@ -6,6 +6,7 @@ library(survival) library(survminer) library(tidyverse) +library(cmprsk) # # Write plot to filename