Kaplan–Meier survival analysis and log-rank test
Survival analysis studies the time until an event (death, relapse, machine failure, customer churn) when some subjects have not had the event by the end of follow-up. The Kaplan–Meier method estimates the survival probability over time using those censored observations correctly, and the log-rank test compares survival between groups.
No sign-up, nothing to install. Calculations run in your browser; the worksheets, results and charts you create are stored by AI Walay to improve DATAJIN.
When to use it
- Clinical studies of time to death, relapse or recovery.
- Engineering reliability: time to failure.
- Business: time until a customer cancels.
Assumptions
- Censoring is unrelated to the outcome (subjects who drop out are not systematically sicker or healthier).
- Survival probability does not depend on when a subject entered the study.
- The log-rank test is most powerful when the hazards in the groups are roughly proportional.
How to run it in DATAJIN
- Create a time column, an event column (1 = event happened, 0 = censored) and, optionally, a group column.
- Open Analyze and choose Survival (Kaplan–Meier + log-rank).
- Assign the time, event and group columns, then click Run.
What you get
- Kaplan–Meier table: time, number at risk, events, survival probability and 95% CI
- Median survival per group (or "not reached")
- Log-rank test: observed and expected events per group, chi-square and p-value
How to interpret the result
The survival column is the estimated probability of remaining event-free beyond each time. Median survival is the time at which survival falls to 50%; "not reached" means more than half the subjects were still event-free. A log-rank p-value below 0.05 means the survival curves differ between groups.
Frequently asked questions
What does censored mean?
A subject is censored when you know they were event-free up to a certain time but not what happened afterwards, for example because the study ended or they were lost to follow-up. Code them 0 in the event column.
Why not just compare average survival times with a t test?
Because censored subjects have incomplete times. Ignoring or dropping them biases the result; Kaplan–Meier and the log-rank test use them correctly.