Skip to main content
v2026.11,858 entries · CC-BY 4.0

Survival Function: Definition, Formula and Worked Example

The survival function S(t) is the probability an event has not yet happened by time t. Formula, hazard link, worked example and code.

Written and maintained by CASRAI Editorial Board

Last updated

The survival function S(t) is the probability that an event has not yet happened by time t. If T is the time until death, relapse, device failure or any other event, then S(t) = Pr(T > t). It starts at 1 and falls toward 0 as time passes. This page defines it, ties it to the CDF, density and hazard, works one example by hand, and shows how to compute it in Excel, R and Python.

Survival function definition

The survival function gives the probability that the variate takes a value greater than x (NIST/SEMATECH e-Handbook). In time-to-event work the variate is a waiting time T, so S(t) is the probability of surviving past t (lifelines documentation). “Survival” does not have to mean life: it means “the event has not occurred yet”, whether the event is death, disease progression, a part failing or a customer leaving.

The survival function is also called the survivor function or the reliability function in engineering. The plot of S(t) against t starts at 1 and decreases monotonically toward zero.

Formula and relation to the CDF, PDF and hazard

Core formula: S(t) = Pr(T > t) = 1 − F(t)

  • T: the random time until the event.
  • t: a specific time at which you evaluate the function.
  • F(t): the cumulative distribution function, Pr(T ≤ t). See the cumulative distribution function (CDF).
  • f(t): the probability density function.
  • h(t): the hazard function, the instantaneous event rate among those still event-free.
  • H(t): the cumulative hazard, the integral of h(t) from 0 to t.

The functions are interchangeable descriptions of the same distribution:

Quantity Relation to S(t) Source
CDF F(t) F(t) = 1 − S(t) NIST e-Handbook
Hazard h(t) h(t) = f(t) / S(t) = −S′(t) / S(t) NIST e-Handbook; lifelines
Cumulative hazard H(t) S(t) = exp(−H(t)) lifelines

Because f(t) = −S′(t), the hazard is the ratio of the density to the survival function, which is how the NIST handbook states it. Knowing any one of S, F, f, h or H lets you derive the others.

Worked example: S(t) from a distribution

This is an illustration with a chosen rate, not data from a study. Suppose event times follow an exponential distribution with a constant hazard of λ = 0.1 per year. Then F(t) = 1 − e−0.1t, so S(t) = e−0.1t.

  • S(5) = e−0.5 = 0.6065. About 60.7% remain event-free past 5 years.
  • S(10) = e−1.0 = 0.3679.
  • Median: solve e−0.1t = 0.5, so t = ln 2 / 0.1 = 0.6931 / 0.1 = 6.93 years.
  • Check with the hazard relation: f(t) = 0.1e−0.1t, so h(t) = f(t) / S(t) = 0.1 at every t. A constant hazard is the signature of the exponential model (the exponential model).

Survival function vs survival curve: the Kaplan-Meier estimate

S(t) is a property of the population distribution. A survival curve is an estimate of S(t) built from observed data. The Kaplan-Meier method multiplies the survival probabilities at every event time up to t. Each interval’s probability is the number surviving divided by the number at risk, and censored subjects leave the at-risk count after their last observation (Goel, Khanna and Kishore, 2010).

Illustrative data (months), 10 subjects. Events at 2, 4, 4, 7, 9 and 12. Censored at 3, 6, 10 and 12. At a tied time, the events are counted before the censored subject leaves.

Time At risk n Events d Factor (n − d) / n S(t) after step
2 10 1 9/10 = 0.900 0.900
3 (censored) 9 0 1 0.900
4 8 2 6/8 = 0.750 0.900 × 0.750 = 0.675
6 (censored) 6 0 1 0.675
7 5 1 4/5 = 0.800 0.675 × 0.800 = 0.540
9 4 1 3/4 = 0.750 0.540 × 0.750 = 0.405
10 (censored) 3 0 1 0.405
12 2 1 1/2 = 0.500 0.405 × 0.500 = 0.2025

The curve drops only at event times and stays flat at censoring times. Because one subject is censored at 12, the estimate ends at 0.2025 and does not reach zero. For reading the plotted curve, see how to read a Kaplan-Meier curve; for the wider method family, see survival analysis with Kaplan-Meier, Cox and parametric models.

Interpretation of S(t)

What you see How to read it
S(t) at a chosen time, e.g. S(5) = 0.61 Estimated probability the event has not occurred by that time.
Time where S(t) first reaches 0.5 or below The median survival time. In the example above, S(7) = 0.54 and S(9) = 0.405, so the median is 9 months.
Steep drop Many events in a short span (a high hazard).
Flat stretch No events in that span, or only censoring.
1 − S(t) The probability the event has occurred by t, which is the CDF.

To compare two survival functions use the log-rank test or a hazard ratio (Cox proportional hazards model). When the curve does not fall below 0.5, use restricted mean survival time instead of a median.

Assumptions and common mistakes

  • Confusing S(t) with F(t). S(t) is the probability of no event yet; F(t) = 1 − S(t) is the probability of an event by t.
  • Deleting censored subjects. A censored subject contributed information up to the last observation. Dropping them, or counting them as events, biases the estimate. In the table they stay in the at-risk count until they leave.
  • Assuming censoring is unrelated to the outcome. The Kaplan-Meier estimate relies on subjects who are censored having the same future risk as those who remain.
  • Reading the tail as precise. Few subjects remain at risk late in follow-up, so late steps rest on very little data. Report the number at risk.
  • Treating a Kaplan-Meier curve as the true S(t). It is an estimate with sampling error.

How to report it

State the method, the number of subjects and events, the censoring, and the quantity you read off the curve. An illustrative results sentence in APA style: “Survival was estimated with the Kaplan-Meier method (N = 10, 6 events, 4 censored). Median survival was 9 months, and estimated survival at 6 months was 0.675.” Add confidence intervals from your software and a number-at-risk table below any plotted curve. Check your target journal’s instructions for required elements.

How to calculate it in Excel, R or Python

Excel

Put times in A2:A11 and status (1 = event, 0 = censored) in B2:B11. List each unique event time in column D (2, 4, 7, 9, 12), then:

E2  (at risk)  =COUNTIF($A$2:$A$11,">="&D2)
F2  (events)   =COUNTIFS($A$2:$A$11,D2,$B$2:$B$11,1)
G2  (factor)   =(E2-F2)/E2
H2  (S)        =PRODUCT($G$2:G2)

Copy the formulas down. The H column reproduces 0.900, 0.675, 0.540, 0.405 and 0.2025.

R

library(survival)
time   <- c(2,3,4,4,6,7,9,10,12,12)
status <- c(1,0,1,1,0,1,1,0,1,0)
fit <- survfit(Surv(time, status) ~ 1)
summary(fit)

The survfit function creates survival curves from a formula such as the Kaplan-Meier. A formula with no right-hand side is no longer supported, so use ~ 1 (R survival package manual).

Python

from lifelines import KaplanMeierFitter
time   = [2,3,4,4,6,7,9,10,12,12]
status = [1,0,1,1,0,1,1,0,1,0]
kmf = KaplanMeierFitter()
kmf.fit(time, event_observed=status)
print(kmf.survival_function_)
print(kmf.median_survival_time_)

FAQ

What is the survival function in simple terms?

It is the probability that the event has not happened by time t. It starts at 1 and does not increase.

What is the difference between the survival function and the CDF?

They add to 1. The CDF F(t) is the probability the event has occurred by t; the survival function is S(t) = 1 − F(t).

How is the survival function related to the hazard function?

h(t) = f(t) / S(t), and S(t) = exp(−H(t)), where H is the cumulative hazard.

How do you find the median from a survival function?

Find the earliest time at which S(t) is 0.5 or lower. In the worked example that time is 9 months.

Sources

  • NIST/SEMATECH e-Handbook of Statistical Methods, Survival Function (checked 2026-10-29).
  • lifelines documentation, Introduction to Survival Analysis (checked 2026-10-29).
  • Goel MK, Khanna P, Kishore J. Understanding survival analysis: Kaplan-Meier estimate. Int J Ayurveda Res 2010;1(4):274-278. PMC3059453 (checked 2026-10-29).
  • R survival package manual, survfit (checked 2026-10-29).

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Survival Function: Definition, Formula and Worked Example

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →

Ask CASRAI · Regulatory Radar

Research-admin question? Get an answer that links its sources.

An AI assistant specialized in research administration. Every answer links its sources to check before you act. 2 questions free, no account. $29/month after.

  • Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.
  • Every answer numbers its sources and links each one, so you can check the source yourself.