I have a survival dataset with outcomes for multiple groups separated into causes of death, and would like to plot the competing risks of each outcome. This tutorial provides an excellent example of using the cpmrsk and survminer packages to plot competing risks, where each group is placed in a separate panel, and the competing risks shown within each of these groups.
Is there a way to instead plot these data so that each outcome is shown in a separate panel, with the data for all of the groups shown within that panel?
Below is an example from this tutorial...
set.seed(2)
failure_time <- rexp(100)
status <- factor(sample(0:2, 100, replace=TRUE), 0:2,
c('no event', 'death', 'progression'))
disease <- factor(sample(1:3, 100,replace=TRUE), 1:3,
c('BRCA','LUNG','OV'))
# Cumulative Incidence Function
require(cmprsk)
fit3 <- cuminc(ftime = failure_time, fstatus = status,
group = disease)
# Visualize
ggcompetingrisks(fit3, palette = "Dark2",
legend = "top",
ggtheme = theme_bw())
Resulting in:
In this example, the goal would be to instead arrange the three different outcomes (death, no, progression) into three separate panels, with each of the three groups (BRCA, LUNG, OV) overlaid in different colours on the same panel.
I know it is possible to combine all of these data onto one graph by specifying ggcompetingrisks(fit3, multiple_panels=F)
but this starts to become difficult to visualise, especially when there become more competing outcomes.
Any advice appreciated, thanks in advance.