kaplan.meier {spatstat.univar} | R Documentation |
Kaplan-Meier Estimator using Histogram Data
Description
Compute the Kaplan-Meier estimator of a survival time distribution function, from histogram data
Usage
kaplan.meier(obs, nco, breaks, upperobs=0)
Arguments
obs |
vector of |
nco |
vector of |
breaks |
Vector of |
upperobs |
Number of observations beyond the rightmost breakpoint, if any. |
Details
This function is needed mainly for internal use in spatstat, but may be useful in other applications where you want to form the Kaplan-Meier estimator from a huge dataset.
Suppose are the survival times of individuals
with unknown distribution function
which we wish to estimate. Suppose these times are right-censored
by random censoring times
.
Thus the observations consist of right-censored survival times
and non-censoring indicators
for each
.
If the number of observations is large, it is efficient to
use histograms.
Form the histogram
obs
of all observed times .
That is,
obs[k]
counts the number of values
in the interval
(breaks[k],breaks[k+1]]
for
and
[breaks[1],breaks[2]]
for .
Also form the histogram
nco
of all uncensored times,
i.e. those such that
.
These two histograms are the arguments passed to
kaplan.meier
.
The vectors km
and lambda
returned by kaplan.meier
are (histogram approximations to) the Kaplan-Meier estimator
of and its hazard rate
.
Specifically,
km[k]
is an estimate of
F(breaks[k+1])
, and lambda[k]
is an estimate of
the average of over the interval
(breaks[k],breaks[k+1])
.
The histogram breaks must include .
If the histogram breaks do not span the range of the observations,
it is important to count how many survival times
exceed the rightmost breakpoint,
and give this as the value
upperobs
.
Value
A list with two elements:
km |
Kaplan-Meier estimate of the survival time c.d.f. |
lambda |
corresponding Nelson-Aalen estimate of the
hazard rate |
These are numeric vectors of length .
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner rolfturner@posteo.net