显示两组差异时如何删除gtsummary包中的CI区间列?
How to delete CI interval column in gtsummary package when displaying differences between two groups?
默认情况下,gtsummary R 包中的函数 add_diference() 创建三列:差异、95% CI 和 p-value。有谁知道热删除CI列吗?
我试图访问 table_styling$header 来隐藏列,但它已经是“FALSE”了。
谢谢
使用modify_column_hide()
函数隐藏95%CI。编程愉快!
library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.5.0'
trial %>%
select(age, marker, trt) %>%
tbl_summary(missing = "no", by = trt) %>%
add_difference() %>%
modify_column_hide(ci) %>%
as_kable() # convert to kable to display on SO
Characteristic
Drug A, N = 98
Drug B, N = 102
Difference
p-value
Age
46 (37, 59)
48 (39, 56)
-0.44
0.8
Marker Level (ng/mL)
0.84 (0.24, 1.57)
0.52 (0.19, 1.20)
0.20
0.12
由 reprex package (v2.0.1)
于 2021-10-18 创建
默认情况下,gtsummary R 包中的函数 add_diference() 创建三列:差异、95% CI 和 p-value。有谁知道热删除CI列吗?
我试图访问 table_styling$header 来隐藏列,但它已经是“FALSE”了。
谢谢
使用modify_column_hide()
函数隐藏95%CI。编程愉快!
library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.5.0'
trial %>%
select(age, marker, trt) %>%
tbl_summary(missing = "no", by = trt) %>%
add_difference() %>%
modify_column_hide(ci) %>%
as_kable() # convert to kable to display on SO
Characteristic | Drug A, N = 98 | Drug B, N = 102 | Difference | p-value |
---|---|---|---|---|
Age | 46 (37, 59) | 48 (39, 56) | -0.44 | 0.8 |
Marker Level (ng/mL) | 0.84 (0.24, 1.57) | 0.52 (0.19, 1.20) | 0.20 | 0.12 |
由 reprex package (v2.0.1)
于 2021-10-18 创建