ABSTRACT

There are many statistical software packages that can be used to implement the techniques described in this book, including SAS, Stata, SPSS and R. Of these, R has become the most widely used because it includes comprehensive facilities for survival analysis, keeps pace with statistical developments, and is freely available to everyone. This chapter shows how R can be used to implement the techniques described in this book. The chapter begins with an outline of the basics of data input and editing. This is followed by sections on using R for summarising survival data, Cox regression modelling, model comparison and validation, and model checking. The use of R to fit parametric accelerated failure time models, flexible models based on splines and models with time-dependent variables is then described. Shorter sections are included on the more specialised techniques in the later chapters, including modelling interval-censored data, frailty modelling, competing risks, dependent censoring, and Bayesian survival analysis. Throughout this chapter, the interpretation of the R output is described and reconciled with worked examples in earlier chapters.