SurvivalModelFit
SurvivalModelFit[{e_{1},e_{2},…}]
creates a survival model for event times e_{i}.
Details and Options
 SurvivalModelFit is used in survival, reliability, and duration analysis. It gives a nonparametric survival distribution as well as measures of confidence directly from incomplete data.
 SurvivalModelFit returns a symbolic SurvivalModel object to represent the survival model it constructs. The properties and diagnostics of the model can be obtained from model["property"].
 The form of events e_{i} follows the form used in EventData.
 Different functional forms of the survival model can be obtained by specifying the form h in model[h]. The following forms can be used:

"CDF" cumulative distribution function "CHF" cumulative hazard function "SF" survival function  The value of the fitted function h from SurvivalModelFit at a particular time t can be found from model[h][t]. model[t] is equivalent to model["SF"][t].
 Specifying Normal[model] gives a pure function form of the estimated survival function.
 A list of available model properties can be obtained using model["Properties"].
 Properties of a fitted function h of the model can be obtained using model["property",h]. The expression model["property"] is equivalent to model["property","SF"].
 Some properties related to the fitted function that can be obtained using model["property"]:

"EventTable" formatted table summarizing the fitted function "EventTableEntries" entries from the event table "FittedFunction" pure functional form of the fitted function "FullEventTable" extended event table "FullEventTableEntries" entries from the full event table "MeanSurvival" the mean survival time "MedianSurvival" the median survival time "StandardErrorFunction" functional form of standard errors of the fitted function "StandardErrors" a list of standard errors for each time point "SurvivalDistribution" the DataDistribution object used in the fitting  Confidence intervals about the fitted function are given as a list of paired values {{h_{1,min},h_{1,max}},…} corresponding to each time point given by model["EstimationPoints"].
 Confidence bands are given as pure functions that are equivalent to confidence intervals when evaluated at all time points in model["EstimationPoints"].
 Properties related to confidence intervals and bands include:

"PointwiseBands" pointwise confidence bands "PointwiseIntervals" pointwise confidence intervals "EqualPrecisionBands" simultaneous confidence bands "EqualPrecisionIntervals" simultaneous confidence intervals "HallWellnerBands" simultaneous Hall–Wellner confidence bands "HallWellnerIntervals" simultaneous Hall–Wellner confidence intervals  Properties related to the event data:

"EstimationPoints" time points used in the estimation "EventData" EventData object used in the estimation "EventMatrix" matrix indicating possible event locations "EventMatrixPlot" a custom matrix plot of the event matrix "TruncationMatrix" matrix indicating where units are observable "TruncationMatrixPlot" a custom matrix plot of the truncation matrix  Properties related to counts of different types of observations:

"AtRisk" number of individuals at risk at each time point "EventCounts" number of events for each time point "LeftCensoringCounts" number of leftcensored events for each time point "ObservationCount" effective number of experimental units "RightCensoringCounts" number of rightcensored events for each time point  SurvivalModelFit takes the following options:

ConfidenceLevel 95/100 level to use for intervals and bands ConfidenceRange All range for simultaneous confidence bands ConfidenceTransform "LogLog" confidence transform to use Method Automatic method to use for model fitting  With ConfidenceLevel>p, probabilityp confidence intervals and bands are computed for the various functional forms.
 ConfidenceRange>{t_{min},t_{max}} gives probabilityp simultaneous confidence intervals and bands for the fitted function between t_{min} and t_{max}.
 Possible settings for ConfidenceTransform include "Linear", "LogLog", "ArcSinSqrt", "Log", "Logit", or a pure function g.
 SurvivalModelFit automatically chooses the method most appropriate to the data. The Kaplan–Meier estimator is used for rightcensored data. For other types of censoring, the estimate is constructed using a selfconsistency approach. Different methods may only support some types of censoring or truncation.
 The setting Method>estimator specifies an estimator to use for distribution functions. Possible settings include:

"KaplanMeier" product limit estimator for rightcensored data "NelsonAalen" based on the Nelson–Aalen cumulative hazard estimator "Turnbull" Turnbull algorithm for intervalcensored data "Noncensored" censoring is ignored and interval midpoints are used "SelfConsistency" Turnbull algorithm for doubly censored data  Additional method settings can be found in the Options section of Examples.
Examples
open allclose allBasic Examples (1)
Scope (29)
Basic Uses (4)
Fit a survival model to some data:
The functional form of the fitted function:
The fitted function evaluated at :
Plot the estimated CDF of the model:
Model Properties (16)
Pointwise confidence intervals:
The 95% pointwise confidence intervals about the survival function at each time point:
The 95% equalprecision intervals about the survival function at each time point:
The 95% Hall–Wellner intervals about the survival function at each time point:
The 95% pointwise confidence bands about the survival function:
Confidence intervals are confidence bands evaluated at each time point:
The 95% equalprecision bands about the survival function:
Equalprecision intervals are equalprecision bands evaluated at each time point:
The 95% Hall–Wellner bands about the survival function:
Equalprecision intervals are equalprecision bands evaluated at each time point:
Standard errors for the fitted function:
Standard errors for the survival function at each time point:
Standard errors are the standard error function evaluated at each time point:
Tabulate a summary of the estimated SurvivalFunction:
Create event tables over custom time ranges:
An event table for times between 25 and 30:
An event table with event history data for times between 25 and 35 in steps of 5:
Some event history properties:
The number of events occurring at each time point:
Use the "EventMatrix" to show where events could have occurred:
Each row represents a distinct event type:
The maximum value in each row is the number of each event type present in the data:
Columns correspond to the following time points:
Use the "TruncationMatrix" to show where units were observable:
Each row represents a distinct event type:
Columns correspond to the following time points:
Visualize the "TruncationMatrix":
Obtain several model properties simultaneously:
A table of event history properties:
Extract properties for the estimated cumulative hazard function of the model:
Data Types (9)
Censoring (7)
Uncensored data can be represented on intervals (no censoring):
The survival functions are equivalent:
Estimate the distribution with rightcensored data (right censoring):
The jump at 16 has been removed and the survival function has been rescaled beyond 16:
A single leftcensored 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 rightcensored 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:
Options (10)
ConfidenceLevel (3)
Set the confidence level used for computing confidence intervals and bands:
A set of 90% intervals corresponding to the time points in the model:
The confidence level can also be set after the model has been fitted:
By default the confidence level is set to :
Compute confidence intervals for the survival probability at a point:
Confidence intervals about the survival function at for a range of confidence levels:
ConfidenceRange (1)
ConfidenceTransform (3)
Apply transformations to confidence intervals and bands:
A collection of named transforms:
"LogLog" bands and intervals are used by default:
Transformations can ensure that intervals and bands are appropriately bounded:
Notice that the upper 95% limit is larger than for some event times:
Using a "LogLog" transform corrects this issue:
Define custom transformations:
Explicit definitions for the various named transforms:
Verify that the definitions are equivalent to the named transforms:
Method (3)
Here a single intervalcensored observation causes the default estimator to be slow: »
The Kaplan–Meier estimator is fast by comparison:
Since the proportion of intervalcensored observations is low, little information is lost:
If the last observation is censored, the survival will be Indeterminate beyond that point:
The "TailModel" suboption can control this behavior:
Provide a particular distribution for the tail:
The suboption "StandardErrorMethod" can be used to control standard error computation:
The setting Automatic attempts to compute standard errors by plugin methods:
Standard errors can also be computed using bootstrapping:
Various suboptions can provide finer control over the bootstrap procedure:
Applications (8)
A group of 26 psychiatric patients were followed until their deaths or the end of the study. Lifetimes of those patients alive at the end of the study are right censored. Compare nonparametric and parametric models for the survival of the patients:
The Kaplan–Meier estimate with 95% pointwise confidence bands and the Gompertz–Makeham model:
The estimated median survival for the two models is similar:
The following data consists of continuous running times (in hours) for 70 generator fans. Of interest is the average number of failures expected for various running times, given a minimal repair policy. Some fans did not fail over the observed period and are right censored:
A plot of the Nelson–Aalen estimate of the cumulative hazard function:
A tabular summary of the cumulative hazard function:
On average, about 0.337 failures are expected for 87,500 hours of operation:
Leukemia patients in remission were treated with 6mercaptopurine or placebo in a clinical trial. Compare the survival of the two groups:
The treatment group is heavily right censored, whereas the control group had no censoring:
Clearly, the treatment group survives longer than the control group:
The LogRankTest with Tarone–Ware weights agrees with the previous findings:
191 high school boys were asked at what age they first tried marijuana. Possible responses include, "I tried marijuana for the first time at age ", "I have never tried marijuana", or "I don't remember the age at which I first tried marijuana":
A summary of the survivor function:
Distribution functions with 95% confidence intervals at each event time:
With 90% confidence, the probability a boy will be older than 14 when he first tries marijuana:
A group of 38 individuals with acute lymphoblastic leukemia were given bone marrow transplants. Patients were followed until death, relapse, or the end of the study. The following data can be interpreted as diseasefree survival times:
Define simultaneous bands over the interval 100 to 600 days:
A comparison of simultaneous and pointwise bands about the diseasefree survival probability:
A hypothesis test for diseasefree survival probabilities:
The probability of surviving, disease free, beyond 400 days:
At 400 days, the diseasefree survival probability is not significantly different from 1/2:
Researchers interested in the sleeping habits of baboons recorded the elapsed time at which half of the baboon troop descended from their trees after sleeping. On some days, the observers arrived early enough to observe this time exactly. At other times they arrived after this median descent time, so the day's observation was left censored:
A 95% Hall–Wellner survival confidence envelope over the interval 7 to 9 hours:
The probability that the median descent time falls in the interval 7 to 9 hours:
The median and mean descent times:
Patients with renal insufficiency were followed to the time to first catheter exit site infection. Each patient had one of two types of catheter placement (surgical or percutaneous). Of interest is which catheter placement is preferable to prevent infection:
It appears that in the long term, percutaneous placement prolongs time to infection:
Compare the nonparametric models to parametric Weibull models:
A group of 30 diabetic subjects were recruited at a clinic and followed until death or the end of the study. The subject's age at entry and age at the end of the study or death were recorded. Using this hypothetical data, compare the conditional survival of 60 and 65yearold diabetics to the survival of diabetics, ignoring lefttruncation:
Condition on surviving to at least 60 and 65 years of age:
The probability a 60yearold diabetic survives beyond 70:
A 90% confidence interval about the probability that a 65yearold diabetic survives beyond 70:
Properties & Relations (7)
The Kaplan–Meier estimator is used by default for rightcensored data:
The Kaplan–Meier productlimit estimator for rightcensored data:
The Nelson–Aalen estimator is based on the cumulative hazard function:
The Nelson–Aalen estimator for rightcensored data:
Transform to the survival function:
The width of confidence intervals increases with confidence level:
Confidence interval widths for three different event times over a range of confidence levels:
Confidence bands and intervals are specific to the form of the fitted function:
Truncation is considered when counting distinct events:
Use CoxModelFit to estimate survival probabilities in the presence of covariates:
Test the overall significance of the model:
Plot survival estimates for the levels of with :
Use LogRankTest to compare hazard rates for multiple groups:
Visually compare survival estimates:
Compare hazard rates using LogRankTest:
Text
Wolfram Research (2012), SurvivalModelFit, Wolfram Language function, https://reference.wolfram.com/language/ref/SurvivalModelFit.html.
CMS
Wolfram Language. 2012. "SurvivalModelFit." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SurvivalModelFit.html.
APA
Wolfram Language. (2012). SurvivalModelFit. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SurvivalModelFit.html