add_confidence_interval {ggsurvfit} | R Documentation |
Add Confidence Interval
Description
Add a confidence interval represented by either a ribbon or lines.
Usage
add_confidence_interval(type = c("ribbon", "lines"), ...)
Arguments
type |
string indicating the type of confidence interval to draw.
Must be one of |
... |
arguments pass to geom.
|
Value
a ggplot2 figure
See Also
Visit the gallery for examples modifying the default figures
Examples
survfit2(Surv(time, status) ~ sex, data = df_lung) %>%
ggsurvfit() +
add_confidence_interval() +
scale_ggsurvfit()
survfit2(Surv(time, status) ~ 1, data = df_lung) %>%
ggsurvfit() +
add_confidence_interval(type = "lines") +
scale_ggsurvfit()
[Package ggsurvfit version 1.1.0 Index]