是否有方法在tbl_regression输出中添加样本大小。意味着模型所用的实际样本?
#example
tbl_regression(model, exponentiate = TRUE)谢谢,
#gtsummary摘要
发布于 2021-02-15 12:46:26
将模型N添加到tbl_regression()表有两种方法。
modify_header()将N包含在列标题中。需要gt汇总v1.3.6或更高版本。add_n()向表中添加一个列,其中包含观察的数量。需要当前开发版本的gt汇总。用remotes::install_github("ddsjoberg/gtsummary")安装开发版本
library(gtsummary)
packageVersion("gtsummary")
#> '1.3.6.9013'
glm(response ~ age, trial, family = binomial) %>%
tbl_regression(exponentiate = TRUE) %>%
modify_header(label ~ "**Characteristic, N = {N}**") %>% # Add N to the column header
add_n() %>% # Add N column to table
add_nevent() # Add Event N column to table

https://stackoverflow.com/questions/66203133
复制相似问题