# Survival analysis example using the "survival" package and leukemia dataset built-in the same package # In this example, first "leukemia" dataset is renamed "df" and the column names are modified to make the command more informative # The standard survival analysis function: fit <- survfit(Surv(survivaltime, event) ~ group, data = df) require("survival") data(leukemia) df <- leukemia df$survivaltime <- df$time df$event <- df$status df$group <- df$x head(df) fit <- survfit(Surv(survivaltime, event) ~ group, data = df) plot(fit) summary(fit)