i

R Programming Complete Tutorial

Survival Analysis

Survival analysis is associated with a collection of statistical methods used to evaluate the time it takes to occur in the event of interest. It is also known as analysis of time to death or failure time analysis. The R survival package is used to carry out survival analysis. This package contains the Surv() function, which takes the input data as an R formula and creates a survival object among the chosen variables for analysis. Then we create the plot using the function survfit().

Survival analysis is used in a wide range of fields, including:

  • Cancer studies for patients survival time analyses,

  • Sociology for “event-history analysis”,

  • In engineering for “failure-time analysis”.

Example:

Graph Output: