Person-years and incidence rate per 1000 person-years

136 Views Asked by At

I am using R, and I have employed the tbl_uvregression() function. However, I would like to include Person years and Incidence rate per 1000 person-years in the table as well.

df3 |>
  select(age, age6, sex, bmi, bmi_cat2,
         scheme_cat, hoscenter_cat1, nation,
         symini_cat3, month_admit, province,death28_cat1,
         favi, dexa, ando, D0Temp, d0temp_38, D0SPO2Pre, d0SPO2Pre_96, 
         exer_postO_3, dd_swabadmit, dd_swabadmit_cat1,timesurvival28_2_year) |>
  mutate(bmi_cat2 = fct_relevel(bmi_cat2, c('18.5 - 22.9', '<18.5', '23.0 - 24.9', '25.0 - 29.9', '30.0 - 34.9', '>=35.0'))) |>
  tbl_uvregression(
    method = coxph,
    y = Surv(timesurvival28_2_year,
             event = death28_cat1 == "Yes"),
    exponentiate = TRUE,
    estimate_fun = purrr::partial(style_ratio, digits = 1),
    pvalue_fun = purrr::partial(style_sigfig, digits = 3)) |>
  add_n(location = "level") |>
  add_nevent(location = "level") |>
  as_gt()
1

There are 1 best solutions below

0
Zé Loff On

Total person-years is simply the sum of the survival times (expressed in years, obviously), and the incidence rate of per 1000 person-years is the number of events, divided by that 1000 times that sum. Those are not results you get from the Cox model, so probably you can't get them from tbl_uvregression alone.