-
Hi again I wonder if there is a way (not necessarily through {ggsurvfit} to extract risk table for weighted CIF? Thanks! Uriah |
Beta Was this translation helpful? Give feedback.
Answered by
ddsjoberg
May 8, 2024
Replies: 1 comment 1 reply
-
Is this what you're after? If so, be sure you're using the latest survival pkg from CRAN and the ggsurvfit version from here: #208 In the latest survival update, there was a change to how the number censored was returned. CRAN update coming vvv soon. library(ggsurvfit)
#> Loading required package: ggplot2
packageVersion("survival")
#> [1] '3.6.4'
packageVersion("ggsurvfit")
#> [1] '1.0.0.9002'
survfit2(Surv(ttdeath, death_cr) ~ 1, tidycmprsk::trial, weights = runif(n = nrow(tidycmprsk::trial))) %>%
tidy_survfit(times = c(0, 12, 24))
#> # A tibble: 6 × 15
#> time n.risk n.censor cum.event cum.censor n.event estimate std.error conf.low
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 96.2 0 0 0 0 0 0 0
#> 2 12 84.2 0 6.12 0 6.12 0.0636 0.0197 0.117
#> 3 24 44.6 44.6 25.6 44.6 19.5 0.266 0.0359 0.347
#> 4 0 96.2 0 0 0 0 0 0 0
#> 5 12 84.2 0 5.88 0 5.88 0.0611 0.0207 0.119
#> 6 24 44.6 44.6 26.0 44.6 20.2 0.271 0.0376 0.355
#> # ℹ 6 more variables: conf.high <dbl>, outcome <chr>, estimate_type <chr>,
#> # estimate_type_label <chr>, monotonicity_type <chr>, conf.level <dbl> Created on 2024-05-08 with reprex v2.1.0 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
uriahf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is this what you're after? If so, be sure you're using the latest survival pkg from CRAN and the ggsurvfit version from here: #208
In the latest survival update, there was a change to how the number censored was returned. CRAN update coming vvv soon.