[Experimental] This helper, to be used with tbl_custom_summary(), creates a function summarizing a continuous variable.

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

image of rendered example table

See also

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

Author

Joseph Larmarange

Examples

# \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)"
  )
# }