km.rs(o, cc, d, breaks)
Suppose $T[i]$ are the survival times of individuals $i=1,\ldots,M$ with unknown distribution function $F(t)$ which we wish to estimate. Suppose these times are right-censored by random censoring times $C[i]$. Thus the observations consist of right-censored survival times $T*[i] = min(T[i],C[i])$ and non-censoring indicators $D[i] = 1(T[i] <= c[i])$="" for="" each="" $i$.<="" p="">
The arguments to this function are
vectors o
, cc
, d
of observed values of $T*[i]$, $C[i]$
and $D[i]$ respectively.
The function computes histograms and forms the reduced-sample
and Kaplan-Meier estimates of $F(t)$ by
invoking the functions kaplan.meier
and reduced.sample
.
This is efficient if the lengths of o
, cc
, d
(i.e. the number of observations) is large.
The vectors km
and hazard
returned by kaplan.meier
are (histogram approximations to) the Kaplan-Meier estimator
of $F(t)$ and its hazard rate $lambda(t)$.
Specifically, km[k]
is an estimate of
F(breaks[k+1])
, and lambda[k]
is an estimate of
the average of $lambda(t)$ over the interval
(breaks[k],breaks[k+1])
. This approximation is exact only if the
survival times are discrete and the
histogram breaks are fine enough to ensure that each interval
(breaks[k],breaks[k+1])
contains only one possible value of
the survival time.
The vector rs
is the reduced-sample estimator,
rs[k]
being the reduced sample estimate of F(breaks[k+1])
.
This value is exact, i.e. the use of histograms does not introduce any
approximation error in the reduced-sample estimator.
reduced.sample
,
kaplan.meier