View source: R/survival-helper.R
medSurv_makeup | R Documentation |
survival::survfit
objectExtract and display median survival time with confidence interval
medSurv_makeup(km_fit, legend = "before matching", time_scale)
km_fit |
returned object from |
legend |
a character string, name used in 'type' column in returned data frame |
time_scale |
a character string, 'years', 'months', 'weeks' or 'days', time unit of median survival time |
a data frame with a index column 'type', median survival time and confidence interval
data(adtte_sat)
data(pseudo_ipd_sat)
library(survival)
combined_data <- rbind(adtte_sat[, c("TIME", "EVENT", "ARM")], pseudo_ipd_sat)
kmobj <- survfit(Surv(TIME, EVENT) ~ ARM, combined_data, conf.type = "log-log")
# Derive median survival time
medSurv <- medSurv_makeup(kmobj, legend = "before matching", time_scale = "day")
medSurv
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.