View source: R/tbl_survfit_times.R
tbl_survfit_times | R Documentation |
Create a gtsummary table with Kaplan-Meier estimated survival estimates and specified times.
tbl_survfit_times(
data,
times,
y = "survival::Surv(time = AVAL, event = 1 - CNSR, type = 'right', origin = 0)",
by = NULL,
label = "Time {time}",
statistic = c("{n.risk}", "{estimate}%", "{conf.low}%, {conf.high}%"),
estimate_fun = label_style_number(digits = 1, scale = 100),
method.args = list(conf.int = 0.95)
)
## S3 method for class 'tbl_survfit_times'
add_overall(
x,
last = FALSE,
col_label = "All Participants \nN = {gtsummary::style_number(N)}",
...
)
data |
( |
times |
( |
y |
( |
by |
( |
label |
( |
statistic |
( |
estimate_fun |
( |
method.args |
(named Note that this list may contain non-standard evaluation components, and
must be handled similarly to tidyselect inputs by using
rlang's embrace operator |
x |
( |
last |
(scalar |
col_label |
( |
... |
These dots are for future extensions and must be empty. |
When the statistic
argument is modified, the statistic labels will likely
also need to be updated. To change the label, call the modify_table_body()
function to directly update the underlying x$table_body
data frame.
a gtsummary table
# Example 1 ----------------------------------
tbl_survfit_times(
data = cards::ADTTE,
by = "TRTA",
times = c(30, 60),
label = "Day {time}"
) |>
add_overall()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.