Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

km

Kaplan-Meier estimate of a survival function


Description

Kaplan-Meier estimate of a survival function.

Usage

km(ti, di)

Arguments

ti

A numerical vector with the survival times.

di

A numerical vector indicating the censorings. 0 = censored, 1 = not censored.

Details

The Kaplan-Meier estimate of the survival function takes place.

Value

A matrix with 4 columns. The non censored times, the number of subjects at risk, the number of events at each time and the estimated survival

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr>

References

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

See Also

Examples

y <- rgamma(40, 10, 1)
di <- rbinom(40, 1, 0.6)
a <- km(y, di)

Rfast2

A Collection of Efficient and Extremely Fast R Functions II

v0.0.9
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Stefanos Fafalios and Marios Dimitriadis.
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.