km: Kaplan-Meier Estimation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/npsurv.R

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
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

npsurv documentation built on Oct. 23, 2020, 5:43 p.m.

Related to km in npsurv...