重命名 gtsummary、tbl_regression/tbl_stack 中的行 [英] Renaming Rows in gtsummary, tbl_regression/tbl_stack

查看:52
本文介绍了重命名 gtsummary、tbl_regression/tbl_stack 中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 gtsummary,并使用 tbl_regression 和 tbl_stack 函数将 11 个不同模型的输出堆叠在一起.我正在寻找一个一致的自变量的优势比如何在不同的感兴趣的因变量之间变化.当我打印出 tbl_stack 输出时,它给了我 11 行重复的自变量名称,而不是我感兴趣的唯一因变量的名称.有谁知道如何重命名 tbl_stack 中的行(手动或自动)) 将因变量名称放在行中?

I am using gtsummary and have stacked tables for the outputs of 11 different models on top of one another using the tbl_regression and tbl_stack functions. I am looking to see how the odds ratios of one consistent independent variable change across different dependent variables of interest. When I print out the tbl_stack output, it gives me 11 repeated rows of the independent variable name of interest, instead of the name of the unique dependent variables I am interested in. Does anyone know how to rename rows in tbl_stack (either manually or automatically) to put the dependent variable names in the rows?

谢谢.

推荐答案

您可以使用 tbl_regression(label=) 参数更改重复变量的标签以匹配每个模型之前的结果你把它们叠起来.

You can use the tbl_regression(label=) argument to change the labels for the repeating variable to match the outcome for each model before you stack them.

然而,有一个使用 tbl_uvregerssion() 的快捷方式.

There is, however, a shortcut using tbl_uvregerssion().

library(gtsummary)
packageVersion("gtsummary")
#> '1.3.6'

trial %>%
  select(response, death, age) %>%
  tbl_uvregression(
    x = age, 
    method = glm,
    method.args = list(family = binomial),
    exponentiate = TRUE
  ) %>%
  modify_header(label ~ "**Outcome**")

这篇关于重命名 gtsummary、tbl_regression/tbl_stack 中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆