[R] need some help about using R for Kaplan-Meier estimator
p.dalgaard at biostat.ku.dk
Sun Feb 1 20:33:36 CET 2009
chen chen wrote:
> Hi Fello:
> I am asked to compute the Kaplan-Meier estimator of data with right
censoring without using surfit().
I.e., a homework problem...
For such problem people will at best offer hints.
The KM estimator is the
---> cumulative product
that depend on
---> the number at risk at the event times.
This gives you a list of three things that you need to figure out how to
> Does anyone know how to use R to
compute the estimators?
> The data should input X: vector of right-censored observed time for n
individuals, and d: vector of failure time indicators (0=censored
> and the function should return with t: vector of sorted observed
> event times, in increasing order; and km:
vector of Kaplan-Meier estimates, corresponding to t.
> Best Regards,
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
O__ ---- Peter Dalgaard Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
More information about the R-help