View source: R/ard_survival_survfit.R
ard_survival_survfit | R Documentation |
Analysis results data for survival quantiles and x-year survival estimates, extracted
from a survival::survfit()
model.
ard_survival_survfit(x, times = NULL, probs = NULL, type = NULL)
x |
( | |||||||||
times |
( | |||||||||
probs |
( | |||||||||
type |
(
|
Only one of either the times
or probs
parameters can be specified.
Times should be provided using the same scale as the time variable used to fit the provided survival fit model.
an ARD data frame of class 'card'
library(survival)
library(ggsurvfit)
survfit(Surv_CNSR(AVAL, CNSR) ~ TRTA, cards::ADTTE) |>
ard_survival_survfit(times = c(60, 180))
survfit(Surv_CNSR(AVAL, CNSR) ~ TRTA, cards::ADTTE) |>
ard_survival_survfit(probs = c(0.25, 0.5, 0.75))
# Competing Risks Example ---------------------------
set.seed(1)
ADTTE_MS <- cards::ADTTE %>%
dplyr::mutate(
CNSR = dplyr::case_when(
CNSR == 0 ~ "censor",
runif(dplyr::n()) < 0.5 ~ "death from cancer",
TRUE ~ "death other causes"
) %>% factor()
)
survfit(Surv(AVAL, CNSR) ~ TRTA, data = ADTTE_MS) %>%
ard_survival_survfit(times = c(60, 180))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.