繁体   English   中英

如何结合优势比和置信区间

[英]How can to combine odds ratios and the confidence intervals

我正在尝试将 OR 和置信区间组合在一列中,以实现以下结果 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() function 合并两列或多列。 下面的例子!

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)

在此处输入图像描述 代表 package (v2.0.0) 于 2021 年 5 月 3 日创建

暂无
暂无

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

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