I am creating a KM plot using survminer:
survfit(Surv(tte, event) ~ trt, data = data) %>%
ggsurvplot(
risk.table = TRUE,
risk.table.pos = "in"
)
This gives a KM curve split by trt, but the risk table is also split by trt too. Is there a way that I can just have the total number across all groups in the risk table, but keep the strata for the plot it's self?
As
ggsurvplotobject is basically a list containing the plot of the survival curve as an element namedplotand the risk table as an elementtable. Hence, one option to achieve your desired result would be to creat twoggsurvplotobject, one stratified by group, one for both or all groups. Afterwards you could take theplotelement from the first and thetableelement from the second.Using the default example from
?ggsurvplot: