# NOT RUN {
# Example 1 ----------------------------------
add_ci_ex1 <-
trial %>%
select(age, response, trt) %>%
tbl_summary(missing = "no",
statistic = all_continuous() ~ "{mean} ({sd})") %>%
add_ci()
# Example 2 ----------------------------------
add_ci_ex2 <-
trial %>%
select(response, trt) %>%
tbl_summary(statistic = all_categorical() ~ "{p}%",
missing = "no") %>%
add_ci() %>%
modify_cols_merge(
rows = !is.na(ci_stat_0),
pattern = "{stat_0} ({ci_stat_0})"
) %>%
modify_footnote(everything() ~ NA)
# }
Run the code above in your browser using DataLab