How to report standard deviations under mean values when using tbl_summary?

Viewed 19

I am using gtsummary::tbl_summary to create a summary statistics table. I am using the following codes to generate the table:

                         by = State, 
                         missing = "no",
                        statistic = list(all_continuous() ~ "{mean} ({sd})",
                        all_categorical() ~ "{n} / {N} ({p}%)")) %>%
                        modify_header(label = "**Variable**") %>%
                        add_p() %>%                      
                        modify_spanning_header(c("stat_1", "stat_2") ~ "**States**") %>%
                        bold_labels()

The above code generates a table where standard deviations are reported within parenthesis next to the mean values. However, I would like the standard deviations to be reported underneath the mean values. How can I tweak my code to do that? Thanks in advance!

0 Answers
Related