Learn R Programming

maicplus (version 0.1.2)

survfit_makeup: Helper function to select set of variables used for Kaplan-Meier plot

Description

Helper function to select set of variables used for Kaplan-Meier plot

Usage

survfit_makeup(km_fit, single_trt_name = "treatment")

Value

a list of data frames of variables from survival::survfit(). Data frame is divided by treatment.

Arguments

km_fit

returned object from survival::survfit

single_trt_name

name of treatment if no strata are specified in km_fit

Examples

Run this code
library(survival)
data(adtte_sat)
data(pseudo_ipd_sat)
combined_data <- rbind(adtte_sat[, c("TIME", "EVENT", "ARM")], pseudo_ipd_sat)
kmobj <- survfit(Surv(TIME, EVENT) ~ ARM, combined_data, conf.type = "log-log")
survfit_makeup(kmobj)

Run the code above in your browser using DataLab