I have the follow code to display multiple statistics. I need to display the confidence interval too, but the code display the CI in the wrong line, I would like to display in same line that mean(sd) are displayed.
library(gtsummary)
iris %>%
select(Sepal.Length, Sepal.Width,Species) %>%
tbl_summary(by = Species,
type = all_continuous() ~ "continuous2",
statistic = all_continuous() ~ c(
"{mean} ({sd})",
"{median} ({p25}, {p75})",
"{min}, {max}"
),
missing = "no", digits = everything() ~ 1) %>%
add_ci(include = all_continuous(),
statistic = all_continuous()~ "{conf.low}, {conf.high}")
Result table:

Table I want:

I am not sure if there is an argument within
add_ci()to get what you need; but we can modify the output and shift the CI columns down.Created on 2024-03-08 with reprex v2.0.2