pharmaverse / ggsurvfit

http://www.danieldsjoberg.com/ggsurvfit/
Other
67 stars 19 forks source link

Add documentation for add_confidence_interval() #132

Closed tengfei-emory closed 1 year ago

tengfei-emory commented 1 year ago

Is your feature request related to a problem? Please describe. One collaborator asked how to customize the colors for survival curves and the corresponding confidence intervals. This can be easily done with built-in ggplot2 features. Just want to suggest adding an example in the documentation.

Describe the solution you'd like Say we want to have red color for both cumulative incidence curve and its confidence interval, we can do this

cuminc(Surv(ttdeath, death_cr) ~ 1, trial) %>%
    ggcuminc(outcome = "death from cancer",color="red") +
    add_confidence_interval(fill="red")

For two groups, we can do this

cuminc(Surv(ttdeath, death_cr) ~ trt, trial) %>%
    ggcuminc(outcome = "death from cancer") +
    add_confidence_interval() +
    scale_color_manual(values=c("blue","red")) + 
    scale_fill_manual(values=c("blue","red"))

Describe alternatives you've considered The above solutions also apply for ggsurvfit.

ddsjoberg commented 1 year ago

links to the gallery have been added! thank you for the suggestion!