continuous_summary {gtsummary} | R Documentation |
Summarize a continuous variable
Description
This helper, to be used with tbl_custom_summary()
, creates a function
summarizing a continuous variable.
Usage
continuous_summary(variable)
Arguments
variable |
String indicating the name of the variable to be summarized. This variable should be continuous. |
Details
When using continuous_summary
, you can specify in the statistic=
argument
of tbl_custom_summary()
the same continuous statistics than in
tbl_summary()
. See the statistic argument section of the help file of
tbl_summary()
.
Example Output
Example 1
Author(s)
Joseph Larmarange
See Also
Other tbl_custom_summary tools:
add_overall()
,
proportion_summary()
,
ratio_summary()
,
tbl_custom_summary()
Examples
# Example 1 ----------------------------------
continuous_summary_ex1 <-
trial %>%
tbl_custom_summary(
include = c("stage", "grade"),
by = "trt",
stat_fns = ~ continuous_summary("age"),
statistic = ~"{median} [{p25}-{p75}]",
overall_row = TRUE,
overall_row_label = "All stages & grades"
) %>%
modify_footnote(
update = all_stat_cols() ~ "Median age (IQR)"
)
[Package gtsummary version 1.7.2 Index]