【问题标题】:How can to combine odds ratios and the confidence intervals如何结合优势比和置信区间
【发布时间】:2021-05-03 13:51:18
【问题描述】:

我正在尝试将 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
  )

【问题讨论】:

    标签: r gtsummary


    【解决方案1】:

    您可以使用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 package (v2.0.0) 于 2021-05-03 创建

    【讨论】:

      猜你喜欢
      • 2014-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-30
      • 2018-01-02
      • 1970-01-01
      相关资源
      最近更新 更多