lifecycle::badge("maturing")
Function takes a survfit
object as an argument, and provides a
formatted summary table of the results
tbl_survfit(x, ...)# S3 method for list
tbl_survfit(
x,
times = NULL,
probs = NULL,
statistic = NULL,
label = NULL,
label_header = NULL,
estimate_fun = NULL,
missing = NULL,
conf.level = 0.95,
reverse = FALSE,
quiet = NULL,
...
)
# S3 method for survfit
tbl_survfit(x, ...)
# S3 method for data.frame
tbl_survfit(x, y, include = everything(), ...)
a survfit object, list of survfit objects, or a data frame. If a data frame is passed, a list of survfit objects is constructed using each variable as a stratifying variable.
For tbl_survfit.data.frame()
and tbl_survfit.survfit()
the arguments
are passed to tbl_survfit.list()
. They are not used when tbl_survfit.list()
is called directly.
numeric vector of times for which to return survival probabilities.
numeric vector of probabilities with values in (0,1) specifying the survival quantiles to return
string defining the statistics to present in the table.
Default is "{estimate} ({conf.low}, {conf.high})"
List of formulas specifying variables labels,
e.g. list(age ~ "Age, yrs", stage ~ "Path T Stage")
, or a string for a
single variable table.
string specifying column labels above statistics. Default
is "{prob} Percentile"
for survival percentiles, and "Time {time}"
for n-year
survival estimates
function to format the Kaplan-Meier estimates. Default
is style_percent()
for survival probabilities and style_sigfig for
survival times
text to fill when estimate is not estimable. Default is "--"
Confidence level for confidence intervals. Default is 0.95
Flip the probability reported, i.e. 1 - estimate
.
Default is FALSE
. Does not apply to survival quantile requests
Logical indicating whether to print messages in console. Default is
FALSE
outcome call, e.g. y = Surv(ttdeath, death)
Variable to include as stratifying variables.
Example 1
Example 2
Example 3
Example 4
Daniel D. Sjoberg
Review list, formula, and selector syntax used throughout gtsummary
Other tbl_survfit tools:
add_n.tbl_survfit()
,
add_nevent.tbl_survfit()
,
add_p.tbl_survfit()
,
modify
,
tbl_merge()
,
tbl_split()
,
tbl_stack()
,
tbl_strata()