简体   繁体   English

将 () 更改为 [] 以获得 gtsummary 表中的置信区间

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

I am making my demographics table using gtsummary.我正在使用 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]例如 9.0 (8.0, 13.0) 到 9.0 [8.0, 13.0]

I appreciate your help我感谢您的帮助

library(gtsummary) tbl_summary(data, by=severe_aki, missing='no')库(gtsummary)tbl_summary(数据,by=severe_aki,缺失='no')

Sorry I made a mistake I want the IQR to appear between []抱歉,我犯了一个错误,我希望 IQR 出现在 [] 之间

here's an example这是一个例子

library(gtsummary) data=colon tbl_summary(data=colon, by=rx, missing='no')库(gtsummary)数据=冒号 tbl_summary(数据=冒号,by=rx,缺失='no')

enter image description here在此处输入图像描述

for.example nodes 2.0 (1.0, 5.0) to 2.0 [1.0, 5.0]例如节点 2.0 (1.0, 5.0) 到 2.0 [1.0, 5.0]

at least about the CI, you can add this to your code:至少关于 CI,您可以将其添加到您的代码中:

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至于 IQR,这里有一个例子

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

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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