represents a survival distribution with event times ei.


represents a survival distribution where events ei occur with censor weights cwi.

Details and Options

  • SurvivalDistribution is used in survival, reliability, and duration analysis.
  • SurvivalDistribution produces a DataDistribution object representing the EmpiricalDistribution of censored lifetime data.
  • The following individual event specifications can be used for ei:
  • tino censoring; event happens at tti
    {ti,}right censoring; event happens at some t where tit
    {-,ti}left censoring; event happens at some t where t<ti
    {ti,min,ti,max}interval censoring; event happens at some t where ti,min<tti,max
  • The following individual censor weight specifications can be used for cwi:
  • cici events at ei
    {ci,ri}ci events and ri right-censored events at ei
    {ci,ri,li}ci events, ri right-censored, and li left-censored events at ei
  • In SurvivalDistribution, the lists of event times and weights must be the same length.
  • EventData[{t1,},{i1,}] can be used to transform event times {t1,} with censoring vector {i1,} to the form {{t1,min,t1,max},}.
  • The following options can be given:
  • Method Automaticmethod to use
    WorkingPrecision Automaticprecision to use in internal computations
  • SurvivalDistribution automatically chooses the method most appropriate to the data. The KaplanMeier estimator is used for right-censored data. For other types of censoring, the estimate is constructed using a self-consistency approach. Different methods may only support some types of censoring.
  • Possible settings for Method include:
  • Automaticautomatically select the most appropriate method
    "Turnbull"Turnbull algorithm for interval-censored data
    "KaplanMeier"product limit estimator for right-censored data
    "NelsonAalen"based on the NelsonAalen cumulative hazard estimator
    "Noncensored"censoring is ignored and interval midpoints are used
    "SelfConsistency"Turnbull algorithm for doubly censored data
  • SurvivalDistribution can be used with such functions as Mean, CDF, and RandomVariate.


open allclose all

Basic Examples  (1)

Create a survival distribution from some right-censored survival data:

Visualize the survival function:

Compute moments and quantiles:

Scope  (24)

Basic Uses  (4)

Create an empirical model for some right-censored survival data:

Use like any other distribution:

Compute probabilities and expectations:

Create a nonparametric maximum likelihood estimate for doubly censored data:

Use EventData to convert status indicators:

Visualize the survival and cumulative hazard functions:

Estimate the distribution for interval-censored data:

The empirical distribution function:

Sample from the distribution:

Specify weights to easily input frequency data:

These weights indicate double censoring:

The estimated survival function:

Distribution Properties  (5)

Estimate distribution functions:

The PDF and hazard function are discrete:

The CDF and survival function are piecewise constant:

Compute moments of the distribution:

Special moments:

General moments:

Quantile function:

Special quantile values:

Generate random numbers:

Only values in the distribution domain are possible:

Compute probabilities and expectations:

Censoring  (7)

Uncensored data can be represented on intervals (no censoring):

The survival functions are equivalent:

Estimate the distribution with right-censored data (right censoring):

The jump at 16 has been removed and the survival function has been rescaled beyond 16:

A single left-censored observation (left censoring):

The jump at 16 is removed and the probability is redistributed over the estimate:

Observations can be censored on an interval (interval censoring):

The third observation occurred somewhere on the interval :

Any combination of left- and right-censored observations is possible (double censoring):

The second observation is left censored and the fourth is right censored:

Any type of censoring can be present in the data simultaneously (mixed censoring):

The second, third, and fourth observations are left, interval, and right censored, respectively:

Use EventData with status indicators to indicate censored observations:

Create distributions for the different censoring schemes:

The survival functions:

Truncation  (2)

Use EventData to specify truncated observations:

The survival functions:

EventData can be used to mix censoring and truncation:

The survival function for some left-truncated and right-censored data:

Censor Weights  (6)

Provide a list of observation censor weights:

The second value was observed twice, causing a greater decline in the survival function at 15:

Specify right censoring with a list of censor weights:

There was one right-censored observation at 15:

Left-censored observations can also be specified in a list of censor weights:

There were three left-censored observations at 15:

Uncensored, right-censored, and left-censored observations can be specified simultaneously:

There were two uncensored, one right-censored, and three left-censored observations at 15:

The censor weight list can be used with interval-censored observations:

The second observation is interval censored and occurred twice:

The censor weight list can be used to drop unwanted observations:

The second observation was dropped:

Options  (6)

Method  (5)

By default, the method used is based on the types of censoring present in the data:

No censoring:

Right censoring only:

Double censoring:

Interval censoring:

Set the maximum number of iterations for iterative algorithms:

The default maximum number of iterations is 10000:

Iterations are not necessary in the absence of left or interval censoring:

The algorithm converges immediately:

Control convergence of Turnbull algorithms:

Mean estimates with increasing PrecisionGoal:

WorkingPrecision  (1)

Estimate the SurvivalFunction using 30-digit-precision arithmetic:

Applications  (7)

Compare the survival rates of breast cancer patients with different immuno-histochemical responses, given the following data and that follow-up times were 116 and 87 weeks for groups one and two, respectively:

Estimate the distributions of each group:

Visually compare the survival functions:

Find the average number of weeks a breast cancer patient survives in the two groups:

Ignoring censoring causes an underestimate in the survival function:

A group of 191 high-school boys was asked the exact age at which they started using marijuana. Responses were "I used it first at age ", "I never used it", and "I have used it but cannot recall when the first time was". Estimate the survival function for time to first marijuana use given the following data:

The probability of a person not having used marijuana at a certain age:

Find the probability of a person having used marijuana at age 15 or earlier:

Estimate the survival of children with acute leukemia treated with the drug 6-mercaptopurine using the NelsonAalen and KaplanMeier estimators:

The estimates are quite similar:

Plot the NelsonAalen estimate of the cumulative hazard function:

Compare survival curves for patients with acute myelogenous leukemia given extended maintenance of chemotherapy (M) versus non-maintained (NM) chemotherapy using the following data:

Show markers at the occurrence of censored observations:

It appears that survival is longer when chemotherapy is maintained:

Estimate the cumulative hazard function for time to retraction for breast cancer patients treated by radiotherapy given the following data:

Show the resulting cumulative hazard function:

Compute the expected time to retraction given the absence of retraction by week 20:

A set of manufactured cords was placed under stress until breakage. Some of the cords were damaged in some way during the study and so their true reliability is right censored. Given the data, estimate the reliability function:

The reliability function is the probability a cord will hold beyond a particular stress:

Determine the expected breaking point, given a cord has not broken at 45 lbs of stress:

The break-point data for 17 ropes is given where the maximum stress applied was 100 lbs of force. Compare the empirical estimate to a Weibull model:

Model the survival function with a censored Weibull distribution:

An empirical model using SurvivalDistribution:

Compute the probability a rope will break beyond 60 lbs of force using the two models:

Properties & Relations  (9)

Probabilities for each observation are distributed in the direction of censoring:

The impact of adding three observations each for three censoring types:

Right-censored observations are truncated at the largest finite endpoint:

The estimates are equivalent:

If the last observation is right censored, the distribution is truncated:

The survival function is truncated at the last finite endpoint at 25:

This endpoint can be set arbitrarily, using a list of weights:

The value 30 was added to the domain of the distribution without adding any observations:

Agreement with the uncensored case diverges with an increased proportion of censoring:

The PDF and hazard function are discrete:

For comparison to continuous distributions, the cumulative hazard function can be used:

CensoredDistribution applies censoring to a distribution, not individual observations:

Treat all observations outside of the window as right censored:

Using Clip on data is equivalent to CensoredDistribution over the same window:

The estimates are equivalent:

With no censoring, SurvivalDistribution is equivalent to EmpiricalDistribution:

Using SurvivalDistribution with TruncatedDistribution is not equivalent to applying truncation to the data if censoring is present:

In the absence of censoring, these are equivalent:

Possible Issues  (5)

The weight list takes precedence over event specifications:

The weight list causes observations at to be added while dropping :

Unspecified positions in the weight list are assumed to be zero:

The left-censored observation was dropped. Place a value in the third position to avoid this:

The weight list can drop data from the analysis but not from the distribution domain:

The value at 30 was dropped from the analysis:

The distribution domain was unaffected:

Decreasing MaxIterations may result in failed convergence:

Try increasing MaxIterations to avoid this:

Setting the Method option may cause SurvivalDistribution to ignore features of the data:

A warning is issued when features are ignored:

Finite endpoints and interval midpoints are treated as known event times using the "Noncensored" method:

Interval midpoints and right endpoints in left-censored observations are treated as known for "KaplanMeier" or "NelsonAalen" methods:

The midpoints of intervals are treated as known using the "SelfConsistency" method:

Wolfram Research (2010), SurvivalDistribution, Wolfram Language function,


Wolfram Research (2010), SurvivalDistribution, Wolfram Language function,


Wolfram Language. 2010. "SurvivalDistribution." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2010). SurvivalDistribution. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_survivaldistribution, author="Wolfram Research", title="{SurvivalDistribution}", year="2010", howpublished="\url{}", note=[Accessed: 28-May-2024 ]}


@online{reference.wolfram_2024_survivaldistribution, organization={Wolfram Research}, title={SurvivalDistribution}, year={2010}, url={}, note=[Accessed: 28-May-2024 ]}