简体   繁体   English

如何在 tbl_regression (gtsummary) 中添加 Cox 比例风险 model 的随访时间/人年?

[英]How do I add follow-up time/person years from a Cox proportional hazards model in a tbl_regression (gtsummary)?

I use tbl_regression from the gtsummary package to depict a Cox proportional hazards model in a table and want to add follow-up time/person years to my tbl_regression table, but cannot seem to find out how to do this.我使用 gtsummary package 中的 tbl_regression 在表中描述 Cox 比例风险 model 并想将后续时间/人年添加到我的 tbl_regression 表中,但似乎无法找到如何执行此操作。

Can anyone help?有人可以帮忙吗? Thank you!谢谢!

Best, Mathilde最好的,玛蒂尔德


cox_cat_noncns <- coxph(Surv(TTD, Dod_status) ~ Highest_Edu_Household, data = data_cox_cat_noncns)

cox_cat_noncns_udj_table <- tbl_regression(cox_cat_noncns,
                                    label = Highest_Edu_Household ~ "Highest parental education",
                                    exponentiate = TRUE %>%
          add_nevent(location = "level") %>%
          bold_labels() %>%
          italicize_levels() %>%
          modify_tabel_styling(
             columns = estimate,
             rows = reference_row %in% TRUE,
             missing_symbol = "Ref.") %>%
          modify_footnote(everything() ~ NA, abbreviation = TRUE) %>%
          modify_table_styling(
             column = p.value,
             hide = TRUE) %>%
          modify_header(
             label= "")

There is a hidden column in the table with the total exposure time.表中有一个隐藏列,其中包含总曝光时间。 The column is hidden by default, and you can unhide it using the modify_header() function (columns with assigned headers are unhidden).默认情况下该列是隐藏的,您可以使用modify_header() function 取消隐藏它(已分配标题的列未隐藏)。 To see all columns available, inspect the tbl$table_body data frame.要查看所有可用列,请检查tbl$table_body数据框。 Happy Porgramming!编程快乐!

library(gtsummary)
library(survival)
packageVersion("gtsummary")
#> [1] '1.5.2'

tbl <-
  coxph(Surv(ttdeath, death) ~ age, trial) %>%
  tbl_regression(exponentiate = TRUE) %>%
  modify_header(exposure ~ "**Exposure**")

在此处输入图像描述 Created on 2022-04-17 by the reprex package (v2.0.1)reprex package (v2.0.1) 创建于 2022-04-17

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

相关问题 如何在 gtsummary 的 tbl_regression 中包含返回字符? - How do I include return characters in tbl_regression from gtsummary? gtsummary R package:如何为 tbl_regression 添加事件数? - gtsummary R package: how to add number of events for tbl_regression? 从 gtsummary 包中省略 tbl_regression 中的协变量 - Omitting covariates in a tbl_regression from gtsummary package 来自 gtsummary package 的 Tbl_regression 用于负二项式回归 - Tbl_regression from the gtsummary package for negative binomial regressions 如何使用 gtsummary 包在 tbl_regression 表中添加趋势 p 值测试 - How to add test for trend p-value in tbl_regression table using gtsummary package 将事件和后续时间添加到 tbl_uvregression - Add events and follow-up time to tbl_uvregression 更改 `gtsummary::tbl_regression` 列 - Change `gtsummary::tbl_regression` columns 使用来自 {gtsummary} 的 tbl_uvregression() function 的多元单变量 Cox 回归 - Multiple univariate Cox regression with tbl_uvregression() function from {gtsummary} 如何使用 gtsummary::tbl_regression() 报告随机效应的方差估计 - How to report variance estimates of random effects using gtsummary::tbl_regression() 更改 tbl_regression/tbl_uvregression 和 tbl_summary 中的默认变量值显示? #g总结 - Change default variable value display in tbl_regression/tbl_uvregression and tbl_summary? #gtsummary
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM