Survival Analysis

Kaplan-Meier & Log-Rank Test

Enter time-to-event data to calculate survival probabilities. You can also compare two groups.

Group 1 Data

Practical Examples

Click on an example to load the data into the calculator.

Basic Survival Data

Single Group

A simple single-group analysis of patient survival times after a treatment.

G1 Times: 6, 7, 10, 15, 19, 25

G1 Statuses: 1, 1, 0, 1, 0, 1

Product Failure Time

Single Group

Analyzing the time until a mechanical component fails, with some units still functional at the end of the study (censored).

G1 Times: 115, 152, 189, 210, 245, 290, 310, 310

G1 Statuses: 1, 1, 1, 0, 1, 1, 0, 0

Comparing Two Drugs

Two Groups

A clinical trial comparing the survival times of patients on a new drug (Group 1) versus a standard drug (Group 2).

G1 Times: 10, 12, 15, 20, 22, 28, 30

G1 Statuses: 1, 1, 0, 1, 1, 0, 1

G2 Times: 8, 9, 11, 14, 16, 21, 25

G2 Statuses: 1, 1, 1, 1, 0, 1, 0

Remission Duration

Two Groups

Comparing the duration of remission for two different cancer therapies. Group 1 is the new therapy, Group 2 is the control.

G1 Times: 9, 13, 13, 18, 23, 28, 31, 34, 45, 48, 57

G1 Statuses: 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0

G2 Times: 7, 10, 15, 19, 22, 26, 30, 35, 39, 42, 48

G2 Statuses: 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1

Other Titles
Understanding Survival Analysis: A Comprehensive Guide
Dive deep into the concepts of time-to-event analysis, the Kaplan-Meier estimator, and the log-rank test to understand how survival data is interpreted and compared.

What is Survival Analysis?

  • Time-to-Event Data
  • The Concept of Censoring
  • The Survival Function
Survival analysis is a branch of statistics for analyzing the expected duration of time until one or more events happen, such as death in biological organisms and failure in mechanical systems. This topic is called time-to-event analysis. The key feature of survival data is that it is often 'censored,' meaning the event of interest has not occurred for some subjects by the end of the study.
Key Concepts in Survival Analysis
To properly understand survival analysis, one must be familiar with three core concepts: Time-to-Event, Censoring, and the Survival Function.

Examples of Survival Data

  • Time from cancer diagnosis to death.
  • Time from a machine's installation to its first failure.
  • Time a user remains subscribed to a service before churning.

The Kaplan-Meier Estimator

  • Calculating Survival Probabilities
  • Constructing a Survival Curve
  • Interpreting the Median Survival Time
The Kaplan-Meier estimator, also known as the product-limit estimator, is a non-parametric statistic used to estimate the survival function from time-to-event data. It is one of the most frequently used methods in medical research for survival analysis. The Kaplan-Meier curve is a graphical representation of this estimate, showing the probability of survival over time.
How it Works
The calculation involves a series of steps. At each time an event occurs, the survival probability is re-calculated by multiplying the previous survival probability by the conditional probability of surviving at that time. Censored subjects are considered 'at risk' until they are censored, but they do not contribute to the event count.

Key Outputs of Kaplan-Meier Analysis

  • A step-wise survival curve showing drops at each event time.
  • A table of survival probabilities at different time points.
  • The median survival time, which is the time at which the survival probability is 50%.

Step-by-Step Guide to Using the Calculator

  • Entering Single-Group Data
  • Comparing Two Groups
  • Interpreting the Results
This calculator simplifies the process of performing survival analysis. Follow these steps to get your results.
For a Single Group
  1. Enter Times: Input the time-to-event for each subject into the 'Time to Event' field, separated by commas.
  2. Enter Statuses: In the 'Event Status' field, enter a '1' if the event occurred or a '0' if the data was censored for the corresponding time. Ensure the number of entries matches the times.
  3. Calculate: Click the 'Calculate' button to see the survival table and median survival time.
For Comparing Two Groups
  1. Enable Comparison: Toggle the 'Compare Two Groups' switch.
  2. Enter Data for Both Groups: Fill in the time and status fields for both Group 1 and Group 2.
  3. Calculate: The results will show separate Kaplan-Meier analyses for each group, plus a log-rank test to compare them.

Input Formatting Rules

  • Time: 5,8,10,12. Status: 1,1,0,1.
  • Ensure no trailing commas.
  • The count of times must equal the count of statuses.

The Log-Rank Test

  • Comparing Survival Curves
  • The Null Hypothesis
  • The Chi-Squared Statistic
The log-rank test is a hypothesis test used to compare the survival distributions of two or more groups. It is a non-parametric test and is appropriate to use when the data are right-skewed and censored. The null hypothesis states that there is no difference in the survival distributions between the groups.
How it's Calculated
The test works by calculating the observed and expected number of events in each group at each event time point if the null hypothesis were true. It then aggregates these values to compute a chi-squared statistic. A high chi-squared value (and a correspondingly low p-value) indicates a significant difference between the survival curves.

Interpreting the P-value

  • p < 0.05: Statistically significant difference. Reject the null hypothesis.
  • p ≥ 0.05: No statistically significant difference. Fail to reject the null hypothesis.

Real-World Applications and Limitations

  • Clinical Trials and Medicine
  • Engineering and Reliability
  • Assumptions and Limitations
Survival analysis is a powerful tool used across many fields.
Applications
  • Medicine: Comparing the efficacy of a new treatment against a placebo.
  • Engineering: Determining the expected lifetime of a machine part (reliability analysis).
  • Business: Analyzing customer churn or employee turnover.
Important Limitations
The primary assumption of the log-rank test is that the hazard rates of the two groups are proportional over time. This means the ratio of the hazard rates is constant. If the survival curves cross, this assumption may be violated, and other tests might be more appropriate. Additionally, the analysis assumes that censoring is non-informative, meaning the reason for censoring is unrelated to the outcome.

When to be Cautious

  • When survival curves cross, violating the proportional hazards assumption.
  • When there are significant confounding variables not accounted for in the analysis.