powered by
Create ggplot2-based graphs for flexible survival models.
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, ...)
an object of class flexsurvreg.
flexsurvreg
the data used to fit survival curves.
the type of survival curves. Allowed values include "survival" (default) and "cumhaz" (for cumulative hazard).
(optional) the summary of the flexsurvreg object as generated by the function summary().
summary()
line size for the flexible survival estimates.
logical. If TRUE, add confidence bands for flexible survival estimates.
same as conf.in.flex but for the kaplan-meier estimates.
conf.in.flex
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 ggsurvplot().
ggsurvplot()
a ggsurvplot
# NOT RUN { if(require("flexsurv")) { fit <- flexsurvreg(Surv(rectime, censrec) ~ group, dist = "gengamma", data = bc) ggflexsurvplot(fit) } # } # NOT RUN { # }
Run the code above in your browser using DataLab