medSurv_makeup {maicplus}R Documentation

Helper function to retrieve median survival time from a survival::survfit object

Description

Extract and display median survival time with confidence interval

Usage

medSurv_makeup(km_fit, legend = "before matching", time_scale)

Arguments

km_fit

returned object from survival::survfit

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

Value

a data frame with a index column 'type', median survival time and confidence interval

Examples

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

[Package maicplus version 0.1.2 Index]