Home > Teaching > Tutorials > Survival Analysis in R

Survival Analysis in R

During Biostat M215, a survival analysis course, I wrote an R tutorial for survival analysis as my final project:

Tutorial PDF

The tutorial itself would be well supplemented by the book Survival Analysis: Techniques for Censored and Truncated Data by Klein and Moeschberger (Amazon.com book version, Amazon Kindle version*, Barnes and Noble), which was the text used for the course I took.

In the tutorial, I assume the reader has some vague knowledge of R and is comfortable with the survival analysis material discussed. In the tutorial I offer a brief run-through of the necessities to run the code. For the survival analysis material, there is a brief review of the topics implemented (although this will not be useful to someone who has no background work in survival analysis).

Data sets used in the tutorial are available on the book's website and also through the R package KMsurv.

Another resource that goes into greater depth on Cox PH models is written by John Fox and may be found here.

Some additional functions have been written to supplement the guide that I think may be useful for the course:
conf.bands() :: function description
local.coxph.test() :: function description
time.dep.coxph() :: function description

The functions above have been checked under several cases, however, they come with ABSOLUTELY NO WARRANTY. If any bugs are found, please email David Diez at david@stat.ucla.edu.