ggflexsurvplot {survminer} | R Documentation |
Ggplots of Fitted Flexible Survival Models
Description
Create ggplot2-based graphs for flexible survival models.
Usage
ggflexsurvplot(
fit,
data = NULL,
fun = c("survival", "cumhaz"),
summary.flexsurv = NULL,
size = 1,
conf.int = FALSE,
conf.int.flex = conf.int,
conf.int.km = FALSE,
legend.labs = NULL,
...
)
Arguments
fit |
an object of class |
data |
the data used to fit survival curves. |
fun |
the type of survival curves. Allowed values include "survival" (default) and "cumhaz" (for cumulative hazard). |
summary.flexsurv |
(optional) the summary of the |
size |
line size for the flexible survival estimates. |
conf.int , conf.int.flex |
logical. If TRUE, add confidence bands for flexible survival estimates. |
conf.int.km |
same as |
legend.labs |
character vector specifying legend labels. Used to replace the names of the strata from the fit. Should be given in the same order as those strata. |
... |
additional arguments passed to the function |
Value
a ggsurvplot
Author(s)
Alboukadel Kassambara, alboukadel.kassambara@gmail.com
Examples
if(require("flexsurv")) {
fit <- flexsurvreg(Surv(rectime, censrec) ~ group,
dist = "gengamma", data = bc)
ggflexsurvplot(fit)
}