Understanding and visualizing Kaplan-Meier curves

Survival Analysis in R

Heidi Seibold

Statistician at LMU Munich

The ggsurvplot function

library(survminer)

ggsurvplot(fit)
ggsurvplot(
  fit, palette = NULL, linetype = 1, 
  surv.median.line = "none", risk.table = FALSE,
  cumevents = FALSE, cumcensor = FALSE, 
  tables.height = 0.25,
  ...
)
Survival Analysis in R

The ggsurvplot function

ggsurvplot(
  fit = km, 
  palette = "blue", 
  linetype = 1, 
  surv.median.line = "hv", 
  risk.table = TRUE,
  cumevents = TRUE, 
  cumcensor = TRUE,
  tables.height = 0.1
)

Survival Analysis in R

The survfit function

survfit(object)
  • If object is a formula: Kaplan-Meier estimation
  • Other options for object (see upcoming chapters):
    • coxph
    • survreg
Survival Analysis in R

Let's practice!

Survival Analysis in R

Preparing Video For Download...