Skip to content

Standardised Survival Probabilities, in R

License

Notifications You must be signed in to change notification settings

ellessenne/standsurv-tutorial-r

Repository files navigation

Standardised Survival Probabilities, in R

This repository contains an R implementation of the Stata code from the manuscript titled Standardised survival probabilities: a useful and informative tool for reporting regression models for survival data, by Syriopoulou et al., and published in 2022 in the British Journal of Cancer.

The content of this repository is organised as follows.

  • Code to clean the data is included in the 01-data.R file;
  • Code to re-create the Kaplan-Meier plots is included in the 02-km.R file;
  • Code to re-create the unadjusted predictions and hazard ratios is included in the 03-hr.R file;
  • Code to re-create the adjusted survival probability predictions is included in the 04-surv-adj.R file;
  • Finally, code to re-create the standardised survival probability predictions (and contrast thereof) is included in the 05-surv-std.R file.

Plots replicating those from the manuscript are included in the output/ folder, in .pdf and .png format, and the original Stata code is included in the source/ folder as well, for completeness.

Note that this repository uses {renv} for reproducibility; after cloning this repository, you can restore the computational environment by running renv::restore() in your R console. You can read more about {renv} here.

License

This software is released under the MIT license.