I have the following data and adjusted the plot to fit my needs, except for the y axis and the risk table.
library(ggsurvfit)
library(survival)
mgus2$etime <- with(mgus2, ifelse(pstat==0, futime, ptime))
event <- with(mgus2, ifelse(pstat==0, 2*death, 1))
mgus2$event <- factor(event, 0:2, labels=c("censor", "pcm", "death"))
mfit2 <- survfit(Surv(etime, event) ~ sex, data=mgus2)
p <- ggcuminc(mfit2) +
scale_x_continuous(name = "FU", breaks = c(0, 100, 200, 300, 400)) +
coord_cartesian(ylim = c(0, 0.20), xlim = c(0, 400), clip = 'on', expand = FALSE) +
add_risktable()
which results in:
How can I adjust the y axis to show percent and manage to fit the risk table as it is cut off?
I tried to edit the table separately with p$table, as used with ggsurvfit, but this is not available with ggcuminc.