Learn R Programming

gtsummary (version 1.6.3)

continuous_summary: Summarize a continuous variable

Description

lifecycle::badge("experimental") 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.

Example Output

Example 1

image of rendered example table

Author

Joseph Larmarange

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().

See Also

Other tbl_custom_summary tools: add_overall(), proportion_summary(), ratio_summary(), tbl_custom_summary()

Examples

Run this code
# \donttest{
# 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)"
  )
# }

Run the code above in your browser using DataLab