A survivor function, , is the probability of surviving to at least time with , where is the cumulative distribution function of the failure times. The Kaplan–Meier or product limit estimator provides an estimate of , , from sample of failure times which may be progressively right-censored.
Let , , be the ordered distinct failure times for the sample of observed failure/censored times, and let the number of observations in the sample that have not failed by time be . If a failure and a loss (censored observation) occur at the same time , then the failure is treated as if it had occurred slightly before time and the loss as if it had occurred slightly after .
The Kaplan–Meier estimate of the survival probabilities is a step function which in the interval to is given by
where is the number of failures occurring at time .
g12aaf computes the Kaplan–Meier estimates and the corresponding estimates of the variances, , using Greenwood's formula,
Gross A J and Clark V A (1975) Survival Distributions: Reliability Applications in the Biomedical Sciences Wiley
Kalbfleisch J D and Prentice R L (1980) The Statistical Analysis of Failure Time Data Wiley
1: – IntegerInput
On entry: the number of failure and censored times given in t.
2: – Real (Kind=nag_wp) arrayInput
On entry: the failure and censored times; these need not be ordered.
3: – Integer arrayInput
On entry: contains the censoring code of the th observation, for .
The th observation is a failure time.
The th observation is right-censored.
or , for .
4: – Character(1)Input
On entry: indicates whether frequencies are provided for each time point.
Frequencies are provided for each failure and censored time.
The failure and censored times are considered as single observations, i.e., a frequency of is assumed.
5: – Integer arrayInput
Note: the dimension of the array ifreq
must be at least
if and at least if .
On entry: if , must contain the frequency of the th observation.
If , a frequency of is assumed and ifreq is not referenced.
if , , for .
6: – IntegerOutput
On exit: the number of distinct failure times, .
7: – Real (Kind=nag_wp) arrayOutput
On exit: contains the th ordered distinct failure time, , for .
8: – Real (Kind=nag_wp) arrayOutput
On exit: contains the Kaplan–Meier estimate of the survival probability, , for time , for .
9: – Real (Kind=nag_wp) arrayOutput
On exit: contains an estimate of the standard deviation of , for .
10: – Integer arrayWorkspace
11: – IntegerInput/Output
On entry: ifail must be set to , . If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this argument, the recommended value is . When the value is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
or , for some .
and , for some .
An unexpected error has been triggered by this routine. Please
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.
The computations are believed to be stable.
Parallelism and Performance
g12aaf is not threaded in any implementation.
If there are no censored observations, reduces to the ordinary binomial estimate of the probability of survival at time .
The remission times for a set of leukaemia patients at distinct time points are read in and the Kaplan–Meier estimate computed and printed. For further details see page 242 of Gross and Clark (1975).