更改 `gtsummary::tbl_regression` 列

Change `gtsummary::tbl_regression` columns

我想使用 statistic 参数重新格式化 gtsummary::tbl_regression similar to tbl_summary 中的列。但是,我找不到相应的参数来进行此调整。感谢您帮助我指出论点!

例如,而不是:

library(dplyr)
library(gtsummary)

glm(response ~ age, trial, family = binomial(link = "logit")) %>%
  tbl_regression(exponentiate = TRUE)

reprex package (v0.3.0)

于 2021-07-13 创建

我愿意:

特征 OR(95%CI;p值)
年龄 1.02 (1.00,1.04; 0.10)

您可以在 gtsummary 中合并列,但我要说的是,此功能并未为用户记录,因为它仍在考虑中,并且在未来的版本中实现可能会略有变化。示例如下!

library(gtsummary)

glm(response ~ age, trial, family = binomial(link = "logit")) %>%
  tbl_regression(exponentiate = TRUE) %>%
  modify_table_styling(
    column = estimate, 
    rows = !is.na(estimate),
    cols_merge_pattern = "{estimate} ({ci}; {p.value})",
    label = "**OR (95% CI; p value)**"
  ) %>%
  modify_footnote(estimate ~ "OR = Odds Ratio, CI = Confidence Interval",
                  abbreviation = TRUE)