secmal: Plot competing risk for SM

Plot competing risk plot for probability of SM and death as competing
risk.
This commit is contained in:
Jens Sauer 2021-01-17 18:52:06 +01:00
parent 471ed09dca
commit 48be520bb0
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -6,6 +6,7 @@
library(survival)
library(survminer)
library(tidyverse)
library(cmprsk)
#
# Write plot to filename