Collect results of a fitted prodlim object in a tibble
as_tibble.prodlim(x, ...)
object obtained with function prodlim
passed to summary.prodlim
A data.table with the results of the prodlim object
By default object contains results for all fitted time points and all strata.
Use arguments times and newdata of summary.prodlim
to subset.
library(tibble)
set.seed(8)
d <- SimCompRisk(17)
fit <- prodlim(Hist(time,event)~X1,data=d)
tibble::as_tibble(fit)
#> # A tibble: 72 × 10
#> X1 time cause n.risk n.event n.lost absolute_risk se.absolute_risk lower
#> <dbl> <dbl> <chr> <int> <int> <int> <dbl> <dbl> <dbl>
#> 1 0 0 1 10 0 0 0 0 0
#> 2 0 0.490 1 10 0 1 0 0 0
#> 3 0 1.61 1 9 0 0 0 0 0
#> 4 0 2.61 1 9 0 0 0 0 0
#> 5 0 3.31 1 9 0 0 0 0 0
#> 6 0 3.73 1 8 0 0 0 0 0
#> 7 0 3.82 1 7 0 0 0 0 0
#> 8 0 3.86 1 7 0 1 0 0 0
#> 9 0 4.27 1 6 0 0 0 0 0
#> 10 0 4.53 1 6 0 0 0 0 0
#> # ℹ 62 more rows
#> # ℹ 1 more variable: upper <dbl>