Survival analysis is a family of statistical techniques designed to analyze the time until an event of interest occurs. Although the name evokes medical contexts where the event is patient death, these techniques apply to any situation where the time until an occurrence is of interest: time to relapse in an addiction, time to school dropout, time to the first panic attack after treatment, or time until a patient achieves remission. In clinical psychology, its use is less frequent than it should be, partly because many researchers are unfamiliar with these techniques and partly because statistics courses in psychology rarely include them.
What makes survival analysis special is its ability to handle a problem that conventional methods do not solve well: censoring. A censored observation is one in which we do not observe the event during the follow-up period. If you are studying time to relapse after treatment for depression and some patients have not relapsed when your study ends, you do not know when (or if) they will relapse. A conventional analysis would force you either to exclude these cases or to treat them as if they had not relapsed, both of which introduce bias. Survival analysis incorporates these censored data naturally, leveraging the partial information they provide (we know the patient survived at least until the end of follow-up).
The Kaplan-Meier curve
The most basic and visual method of survival analysis is the Kaplan-Meier curve, which estimates the probability of "surviving" (that is, of not having experienced the event) over time. The curve starts at 1.0 (at the beginning, no participant has experienced the event) and descends in steps each time someone experiences the event. Censored data are typically marked with small vertical marks on the curve, indicating that the participant ceased to be observed at that point without having experienced the event. If you just need the curve and the median survival time with its 95% CI without opening R or SPSS, our Kaplan-Meier calculator generates it from your times and events.
When you want to compare the survival curves of two groups (for example, treatment versus control), the log-rank test is the standard nonparametric test. It compares the curves globally across the entire follow-up period and produces a p-value indicating whether the curves differ significantly. However, the log-rank test has limitations: it assumes that the group effect is proportional over time (that is, that the advantage of one group over the other is constant), and it does not allow adjustment for covariates. To overcome these limitations, you need the Cox model.
The Cox proportional hazards regression model
The Cox proportional hazards model is to survival analysis what linear regression is to continuous data analysis: the fundamental multivariate tool. It allows you to evaluate the effect of multiple predictors on the risk of experiencing the event, expressing results as hazard ratios, a close cousin of the odds ratio and relative risk. A hazard ratio of 2.0 for a variable means that participants with that characteristic have twice the risk of experiencing the event at any given time, compared to participants without it.
The fundamental assumption of the Cox model is proportionality of hazards: the effect of each predictor on risk is constant over time. If a treatment reduces the risk of relapse by half, that reduction remains the same at 3 months, 6 months, and one year. This assumption can be evaluated statistically (with the Schoenfeld test) and graphically (with Schoenfeld residuals), and it is important to verify because its violation can invalidate the interpretation of the hazard ratio. If the assumption is not met, alternatives include incorporating interactions with time, stratifying by the problematic variable, or using more flexible models.
Applications in psychology and recommendations
In clinical psychology, survival analysis is particularly useful in treatment efficacy studies where the outcome is not simply whether the patient improved or not, but how long it took to improve or how long the improvement was maintained. A clinical trial showing that two treatments have the same remission rate at the end of follow-up could reveal, through survival analysis, that one of them produces remissions much more quickly. This information has direct clinical implications that a simple analysis of proportions would not capture.
In R, the survival package is the fundamental reference, with functions for Kaplan-Meier estimation (survfit()), the log-rank test (survdiff()), and the Cox model (coxph()). The survminer package facilitates the creation of high-quality survival plots. In SPSS, survival analysis is available under the Analyze > Survival menu, with options for Kaplan-Meier and Cox regression. If you work with clinical data where time to event is relevant, I recommend incorporating these techniques into your analytical repertoire. They are no more difficult to apply than logistic regression, and the additional information they provide about the temporal dynamics of the phenomenon can be decisive for the clinical interpretation of your results.
A design note: in survival analysis, statistical power is driven by the number of events, not just the number of participants, so it is worth calculating the sample size a priori based on the events you expect.
Does your study measure time to an event?
I am a PhD in Psychology and I run the full survival analysis (Kaplan-Meier, log-rank, Cox and the proportional-hazards check) in R or SPSS, with the write-up ready for the journal or committee. In medicine, nursing, psychology or any clinical study. Free initial diagnosis.
See the statistical consulting →