Survival analysis guide
When your outcome is the time until something happens, the right method depends on how your data are structured and what question you’re asking.
How long until a cancer comes back after treatment? How long before a customer cancels a subscription? How long does a machine run before it breaks down? These are all survival analysis questions, and they share one feature: it matters not just whether the event happens but when it happens.
There’s a catch: some subjects are still event-free when observation ends. Survival analysis puts that partial information to work instead of throwing it away. This guide explains censoring and event types, then shows how to choose among Kaplan–Meier, Cox, AFT, and extended models based on what you want to learn. The calculations and how to read each output table are covered in the individual chapters.
Check four things before you choose a method
Start by looking at how events and follow-up times were recorded.
Censoring doesn’t mean the event never happened. Say a customer has been followed for 12 months and is still subscribed. We don’t know when they’ll cancel, but we do know they went at least 12 months without canceling, and that information counts.
A map for choosing a survival method
The main methods, sorted by your goal and by how the events are structured.
Treat this map as a starting point. The same data set can answer quite different questions: comparing survival rates is not the same job as studying risk factors. And when people can die from several causes, for example, you first have to ask whether it’s really fine to treat deaths from other causes as ordinary censoring.
Describing survival or comparing groups
Methods for estimating survival curves and checking for differences between groups.
Showing the probability of surviving over time
Suppose you want to estimate what share of treated patients are still relapse-free at 6 months and at 12 months. Kaplan–Meier estimation takes censoring into account and gives you a survival curve.
Comparing survival curves across two or more groups
To check whether time to relapse differs between treatment A and treatment B, consider the log-rank test. If the curves cross or the proportional hazards assumption looks shaky, look at other ways of comparing them too.
Comparing average event-free time over a fixed window
Say you want to compare how long two groups stay event-free over the same 24-month window. Restricted mean survival time (RMST) answers exactly that. The key is to fix the time limit in advance.
Analyzing what drives survival time
Decide whether you want to explain the hazard or the survival time itself.
| Research question | Typical method | Check first |
|---|---|---|
| How are age and type of treatment related to the risk of the event? | Cox proportional hazards model | Proportional hazards assumption; how covariates are defined |
| How much does a given factor lengthen or shorten the time to the event? | AFT model | Fit of the chosen survival-time distribution |
| Do you want to model survival time as following a specific distribution? | Parametric survival model | Choice of distribution and goodness of fit |
| Does medication use or exposure status change during the study? | Cox with time-varying covariates | When the variable changed, and the order of events in time |
A Cox hazard ratio and an AFT time ratio are different numbers, and you read them differently. Decide which kind of effect you want to describe before you pick a model.
When the event structure gets complicated
Situations that go beyond the basic one-event setup.
When events compete — competing risks analysis
Say you’re tracking cancer relapse, but some patients die of other causes before they ever relapse. One event can rule out another. Here you need to keep two things apart: the cumulative incidence of each event and its cause-specific hazard.
When subjects move through several states — multistate models
When subjects move from state to state (admitted → discharged → readmitted), you analyze the transitions between states together with the time each one takes.
When the same event happens more than once — recurrent events models
Think of a customer who pauses a service several times, or a patient who keeps getting readmitted. Events in the same person tend to be related, and the model has to account for that.
When some subjects may never have the event — cure models
If there’s good reason to believe some subjects will never experience the event, even after long follow-up, a cure model is worth a look. Just don’t confuse this with events that haven’t shown up yet because follow-up was too short.
What should you check before running the analysis?
In survival analysis, the way time and events are recorded matters more than usual.
| What to check | Why it matters |
|---|---|
| Time zero | Everyone needs a comparable starting point, such as the start of treatment or the sign-up date. |
| Event definition and coding | If the event and censoring codes get swapped, the results will be wrong. |
| Nature of the censoring | Standard methods assume, among other things, that censoring is noninformative. Find out why subjects were lost to follow-up. |
| Number of events and follow-up time | How stable your estimates are depends not only on the number of participants but on how many events actually occurred and how long people were followed. |
| Model-specific assumptions | Check the assumptions that go with your method: proportional hazards for Cox, distributional fit for AFT, and so on. |
| Recurrent and competing events | Ask whether it’s really okay to lump several events in the same person, or different types of events, into a single event. |
When only a handful of subjects are left late in follow-up, the tail of a Kaplan–Meier curve can be unstable. Don’t read the curve on its own; also check the number at risk at each time point and the confidence intervals.
All 12 survival methods at a glance
A quick look at what each method is for. The individual chapters explain how each one works and how to interpret it.
Survival curves & group comparisons
Risk factors & time models
Extended event structures
※ These 12 methods are the core options in survival analysis. Depending on your study design, other extensions, such as shared frailty models, may also be worth considering.
In survival analysis, sort out the events and the time structure first.
Before choosing a method, pin down four things: (1) time zero and the event definition, (2) censoring, (3) your research question, and (4) the structure of the events.
Decide whether you want to show time to event, compare groups, or explain risk factors. Kaplan–Meier and the log-rank test estimate and compare survival curves; Cox and AFT models estimate the effects of covariates. Then check for censoring and for competing or recurrent events, and the list of suitable methods gets much shorter. If there are several event types, or events that repeat, look to an extended model built for that structure.