km {npsurv} | R Documentation |
km
computes the nonparametric maximum likelihood esimate (NPMLE) of a
survival function for right-censored data.
km(data, w = 1)
data |
vector or matrix, or an object of class |
w |
weights/multiplicities of observations. |
For details about the arguments, see icendata
.
A list with components:
f |
NPMLE, an object of class |
ll |
log-likelihood value of the NPMLE |
Yong Wang <yongwang@auckland.ac.nz>
Kaplan, E. L. and Meier, P. (1958). Nonparametric estimation from incomplete observations. Journal of the American Statistical Association, 53, 457-481.
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