# \donttest{
# Example 1 ----------------------------------
tbl_overall_ex1 <-
trial %>%
tbl_summary(include = c(age, grade), by = trt) %>%
add_overall()
# Example 2 ----------------------------------
tbl_overall_ex2 <-
trial %>%
tbl_summary(
include = grade,
by = trt,
percent = "row",
statistic = ~ "{p}%",
digits = ~ 1
) %>%
add_overall(
last = TRUE,
statistic = ~ "{p}% (n={n})",
digits = ~ c(1, 0)
)
# Example 3 ----------------------------------
tbl_overall_ex3 <-
trial %>%
tbl_continuous(
variable = age,
by = trt,
include = grade
) %>%
add_overall(last = TRUE)
# }
Run the code above in your browser using DataLab