km {npsurv}R Documentation

Kaplan-Meier Estimation

Description

km computes the nonparametric maximum likelihood esimate (NPMLE) of a survival function for right-censored data.

Usage

km(data, w = 1)

Arguments

data

vector or matrix, or an object of class icendata.

w

weights/multiplicities of observations.

Details

For details about the arguments, see icendata.

Value

A list with components:

f

NPMLE, an object of class idf.

ll

log-likelihood value of the NPMLE f.

Author(s)

Yong Wang <yongwang@auckland.ac.nz>

References

Kaplan, E. L. and Meier, P. (1958). Nonparametric estimation from incomplete observations. Journal of the American Statistical Association, 53, 457-481.

See Also

icendata, npsurv, idf.

Examples


x = cbind(1:5, c(1,Inf,3,4,Inf))
(f = km(x)$f)
plot(f)

data(leukemia)
i = leukemia[,"group"] == "Placebo"
plot(km(leukemia[i,1:2])$f, xlim=c(0,40), col="green3") # placebo
plot(km(leukemia[!i,1:2])$f, add=TRUE)                  # 6-MP


[Package npsurv version 0.5-0 Index]