The tidycmprsk package exports a tidier for "cuminc"
objects.
This function adds on top of that and returns more information.
Arguments
- x
a 'cuminc' object created with
tidycmprsk::cuminc()
- times
numeric vector of times. Default is
NULL
, which returns all observed times.
Examples
library(tidycmprsk)
cuminc(Surv(ttdeath, death_cr) ~ trt, trial) %>%
tidy_cuminc()
#> # A tibble: 228 × 16
#> time outcome strata estim…¹ std.e…² conf.low conf.…³ n.risk n.event n.cen…⁴
#> <dbl> <chr> <fct> <dbl> <dbl> <dbl> <dbl> <int> <int> <int>
#> 1 0 death f… Drug A 0 0 NA NA 98 0 0
#> 2 3.53 death f… Drug A 0 0 NA NA 98 0 0
#> 3 7.27 death f… Drug A 0.0102 0.0102 8.84e-4 0.0503 97 1 0
#> 4 7.38 death f… Drug A 0.0204 0.0144 3.90e-3 0.0652 96 1 0
#> 5 8.37 death f… Drug A 0.0204 0.0144 3.90e-3 0.0652 95 0 0
#> 6 10.1 death f… Drug A 0.0204 0.0144 3.90e-3 0.0652 94 0 0
#> 7 10.3 death f… Drug A 0.0204 0.0144 3.90e-3 0.0652 93 0 0
#> 8 10.5 death f… Drug A 0.0204 0.0144 3.90e-3 0.0652 92 0 0
#> 9 11.4 death f… Drug A 0.0306 0.0175 8.17e-3 0.0798 91 1 0
#> 10 11.8 death f… Drug A 0.0306 0.0175 8.17e-3 0.0798 90 0 0
#> # … with 218 more rows, 6 more variables: cum.event <int>, cum.censor <int>,
#> # strata_label <chr>, estimate_type <chr>, estimate_type_label <chr>,
#> # monotonicity_type <chr>, and abbreviated variable names ¹estimate,
#> # ²std.error, ³conf.high, ⁴n.censor