Ready-to-publish Kaplan Meier Plots in R

Kaplan-Meier plots are the most popular graphical displays of time-to-event (survival) data, because they give an intuitive and concise overview of survival over time.

In this tutorial we run through a short example using the survminer package to obtain a well annotated Kaplan-Meier plot, which includes:

  • a legend with proper group labels
  • the log rank test p-value for testing differences in survival between the treatment groups
  • the at-risk table indicating the number of patients in each group at different time points.
Check below the video for an easy option to download this R code, which will save you a lot of time!

The output will look like this:

Check out this quick and easy video for a step-by-step guide on how to produce this graphic in R:

Note: If you are looking for more details on how to use ggsurvplot() from the survminer package check out these helpful vignettes maintained by the package author:

https://cran.r-project.org/web/packages/survminer/vignettes/Informative_Survival_Plots.html

https://cran.r-project.org/web/packages/survminer/vignettes/Playing_with_fonts_and_texts.html

Leave a Reply

Close Menu