SLIDE 1
Survival analysis in R
Niels Richard Hansen This note describes a few elementary aspects of practical analysis of survival data in R. For further information we refer to the book “Introductory Statistics with R” by Peter Dalgaard and “Dynamic Regression Models for Survival Data” by Torben Martinussen and Thomas Scheike and to the R help files. There is also the classical reference “Statistical Models Based on Counting Processes” by Andersen, Borgan, Gill and Keiding. The analyses that we will do can all be done using the functions in library sur-
- vival. That library also contains some example data sets.
> library(survival) > data(pbc) > pbc[1:10, c("time", "status", "age", "edema", "alb", "bili", + "protime")] time status age edema alb bili protime 1 400 1 58.7652 1 2.60 14.5 12.2 2 4500 0 56.4463 0 4.14 1.1 10.6 3 1012 1 70.0726 1 3.48 1.4 12.0 4 1925 1 54.7406 1 2.54 1.8 10.3 5 1504 0 38.1054 0 3.53 3.4 10.9 6 2503 1 66.2587 0 3.98 0.8 11.0 7 1832 0 55.5346 0 4.09 1.0 9.7 8 2466 1 53.0568 0 4.00 0.3 11.0 9 2400 1 42.5079 0 3.08 3.2 11.0 10 51 1 70.5599 1 2.74 12.6 11.5 The data set contains the main variable time, which is the observed, potentially censored survival time and the status, which indicates if the observation has been
- censored. In addition there are 17 observed covariates, where we show above five