r - How can to combine odds ratios and the confidence intervals
问题描述
I am trying to combine the ORs and confidence interval in one column so as to achieve the following results 1.10(0.52,2.29)
library(gtsummary)
trial %>%
select(response, grade) %>%
tbl_uvregression(
method = glm,
y = response,
method.args = list(family = binomial),
exponentiate = TRUE
)
解决方案
您可以使用该modify_table_styling()
功能合并两列或多列。下面的例子!
library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.4.0'
tbl <-
trial %>%
select(response, grade) %>%
tbl_uvregression(
method = glm,
y = response,
method.args = list(family = binomial),
exponentiate = TRUE
) %>%
modify_table_styling(
columns = estimate,
rows = !is.na(ci),
cols_merge_pattern = "{estimate} ({ci})"
) %>%
modify_header(estimate ~ "**OR (95% CI)**") %>%
modify_footnote(estimate ~ "OR = Odds Ratio, CI = Confidence Interval",
abbreviation = TRUE)
由reprex 包于 2021-05-03 创建 (v2.0.0 )
推荐阅读
- github - GitHub 铅笔(编辑)按钮消失
- javascript - 如何读取 API 文档中的函数参数?
- ios - 无法访问 gcm 数据响应
- xamarin - 当用户在 Xamarin Forms 中从我的应用 (Android) 拨打联系人号码时,总是拨打电话应用?
- php - PHP如何将部分数据库查询放入函数中
- javascript - 将 Javascript 对象(svgCrowbar 输出)上传到 Laravel 5.6 服务器
- vim - 删除vim中所有空格的命令
- hyperledger-composer - 是否可以通过 getNative().invokeChaincode() 在两个网络上使用 Composer 测试单元?
- sql-server - 使用 IF 条件在 SQL Server 中的 UNION 内获取查询
- ios - 在 Xamarin 中隐藏后退按钮文本