16.1 Background
You can specify the survival distribution function either as a survival function of the form
\[S(t) = 1 - F(t) = pr(T > t), \hspace{3mm} 0 < t < \infty\]
or as a hazard function, the instantaneous failure rate given survival up to time \(t\)
\[h(t) = \lim_{\delta \rightarrow 0}{\frac{pr(t < T < t + \delta|T > 1)}{\delta}}.\]
The survival function is the compliment of the the cumulative distribution function. The Kaplan-Meier estimator for the survival function is
\[\hat{S} = \prod_{i: t_i < t}{\frac{n_i - d_i}{n_i}}\]
where \(n_i\) is the number of persons under observation at time \(i\) and \(d_i\) is the number of individuals dying at time \(i\). Calculate the Kaplan-Meier estimate with the survfit()
function.