Survival analysis

Christian Baghai
2 min readApr 4, 2021

Programmers are often called upon to program survival analysis and produce tables and figures (For example: Kaplan Meier Curves). Performing such analysts often time involves using PROC LIFETEST

What is survival analysis and the kaplan-meier analysis?

Survival Analysis represents a set of statistical methods used to estimate the length of time between two clearly defined events. Survival data is often analyzed in terms of time to event. In an analysis with clinical trial data, it is often referred to as time to response or time to failure analysis (For example: Time to responding to a treatment or relapse or death). Survival analysis estimates the probability of survival as a function of time. This is often expressed as the proportion of patients expected to survive a certain amount of time after receiving treatment. Survival analysis can be used to assess the dependence of the time to event variable with an independent variable, which is most of the time the treatment arm.

How to analyze censored records?

In survival analysis for a given subject, the study may end or the subject may leave the study before the event is observed. This can be for a positive reason, such as the subject is alive at the end of the study. There are also cases where the subject is “lost to follow-up” before the study ends. This such record is called “censored data”. This censored data cannot be analyzed by simply dropping it. In fact, the events that did not occur are part of your findings and should be included in your statistical analysis (For example, kaplan-meier analysis). However, one should pay attention to the fact that using the time of censoring as time to the event would not be correct. In that case, even though the event is not actually observed, we can assume that the time to event exceeded the last date of contact. In that case the last date of contact will be the observed date of survival. The programmer should keep in mind that in that case the actual date of survival is unknown. Therefore, the actual data of survival is equal or greater to the observed data of survival. This is called “right censoring”.

The Kaplan-Meier curve

The Kaplan-Meier curve, also called the Product Limit Estimator is a survival analysis method that estimates the probability of survival to a given time using proportion of patients who have survived until a given time point. Kaplan-Meier analysis take into account censored observations. Censored observations are incorporated into the analysis up until the time of censoring. The Kaplan Meier analysis makes the assumption that if subjects had been followed beyond the censored time point then they would have had the same survival probabilities as those that are not censored at that same time point.

--

--