简体   繁体   中英

Changing () to [] for confidence interval in gtsummary table

I am making my demographics table using gtsummary. I want the confidence interval in my table to appear between [] not (). For example 9.0 (8.0, 13.0) to 9.0 [8.0, 13.0]

I appreciate your help

library(gtsummary) tbl_summary(data, by=severe_aki, missing='no')

Sorry I made a mistake I want the IQR to appear between []

here's an example

library(gtsummary) data=colon tbl_summary(data=colon, by=rx, missing='no')

enter image description here

for.example nodes 2.0 (1.0, 5.0) to 2.0 [1.0, 5.0]

at least about the CI, you can add this to your code:

trial %>%
  select(response, grade) %>%
  tbl_summary(statistic = all_categorical() ~ "{p}%",
              missing = "no") %>%
  modify_footnote(everything() ~ NA) %>%
  
  add_ci(pattern = "{stat} [{ci}]") 

在此处输入图像描述

As for the IQR, here is an example

  trial %>%
    select(age) %>%
    tbl_summary(
                statistic =  all_continuous() ~ "{mean} [{IQR}]",
                missing = "no") 

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM