[英]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.