Skip to main content
Back to Guides
4 min read5 Steps

How to Calculate Kaplan-Meier Survival Curve: Step-by-Step Guide

Calculate Kaplan-Meier survival curve manually

Skip the math — use the calculator

Step-by-Step Instructions

1

Gather Your Inputs

First, identify the event times and censoring status for each patient. Event times are the times at which the event of interest (e.g., death) occurs, while censoring status indicates whether the patient was censored (i.e., the event did not occur during the study period) or not.

2

Sort the Event Times

Next, sort the event times in ascending order. This will help you to identify the time points at which the survival probability changes.

3

Calculate the Number of Patients at Risk

At each time point, calculate the number of patients who are still at risk of experiencing the event. This includes all patients who have not yet experienced the event and have not been censored.

4

Calculate the Survival Probability

The survival probability at each time point can be calculated using the following formula: S(t) = (1 - d(t)/n(t))

5

Plot the Survival Curve

Finally, plot the survival probability at each time point to visualize the Kaplan-Meier survival curve. This will help you to identify the pattern of survival over time.

Introduction to Kaplan-Meier Survival Curve

The Kaplan-Meier survival curve is a statistical method used to estimate the survival function of a population. It is commonly used in medical research to analyze the survival time of patients. In this guide, we will walk you through the steps to calculate the Kaplan-Meier survival curve manually.

Step-by-Step Calculation

To calculate the Kaplan-Meier survival curve, you need to follow these steps:

Step 1: Gather Your Inputs

First, identify the event times and censoring status for each patient. Event times are the times at which the event of interest (e.g., death) occurs, while censoring status indicates whether the patient was censored (i.e., the event did not occur during the study period) or not.

Step 2: Sort the Event Times

Next, sort the event times in ascending order. This will help you to identify the time points at which the survival probability changes.

Step 3: Calculate the Number of Patients at Risk

At each time point, calculate the number of patients who are still at risk of experiencing the event. This includes all patients who have not yet experienced the event and have not been censored.

Step 4: Calculate the Survival Probability

The survival probability at each time point can be calculated using the following formula: S(t) = (1 - d(t)/n(t)) where:

  • S(t) is the survival probability at time t
  • d(t) is the number of events that occur at time t
  • n(t) is the number of patients at risk at time t

Worked Example

Let's say we have the following event times and censoring status:

Patient ID Event Time Censoring Status
1 10 0 (event occurred)
2 15 1 (censored)
3 8 0 (event occurred)
4 20 1 (censored)
5 12 0 (event occurred)

First, we sort the event times in ascending order: 8, 10, 12, 15, 20. Then, we calculate the number of patients at risk at each time point:

  • At time 8, 5 patients are at risk
  • At time 10, 4 patients are at risk (patient 3 has experienced the event)
  • At time 12, 3 patients are at risk (patients 1 and 3 have experienced the event)
  • At time 15, 2 patients are at risk (patients 1, 3, and 5 have experienced the event or been censored)
  • At time 20, 1 patient is at risk (patients 1, 3, 4, and 5 have experienced the event or been censored)

Using the formula, we can calculate the survival probability at each time point:

  • At time 8, S(8) = (1 - 1/5) = 0.8
  • At time 10, S(10) = (1 - 1/4) = 0.75
  • At time 12, S(12) = (1 - 1/3) = 0.67
  • At time 15, S(15) = (1 - 0/2) = 1 (since no event occurred at this time point)
  • At time 20, S(20) = (1 - 0/1) = 1 (since no event occurred at this time point)

Common Mistakes to Avoid

When calculating the Kaplan-Meier survival curve manually, make sure to:

  • Sort the event times correctly
  • Calculate the number of patients at risk correctly
  • Use the correct formula for calculating the survival probability

When to Use the Calculator

While calculating the Kaplan-Meier survival curve manually can be useful for small datasets, it can be time-consuming and prone to errors for larger datasets. In such cases, it is recommended to use a Kaplan-Meier calculator to ensure accuracy and convenience.

Ready to Calculate?

Skip the manual work and get instant results.

Open Calculator

Settings

PrivacyTermsAbout© 2026 PrimeCalcPro