[R] Kaplan Meier function

Matthias Gondan matthias-gondan at gmx.de
Thu Feb 14 15:35:08 CET 2008


Hi Eleni, hi list,

here is small sample program, the library is "survival", it is included
in the standard R distribution.

> data(colon)
> s = survfit(Surv(time, status) ~ rx, data=colon)
> plot(s)
> plot(s, col=1:3)

By the way: Does anyone know a neat way to indicate the number of
patients under risk in
the curve? Like here:

http://www.drugs.com/pro/images/8c3bb783-1c3c-4d75-a502-2f7ee3632f41/inspra-image02.jpg

Best wishes,

Matthias

Eleni Christodoulou schrieb:
> Hi all,
>
> I am trying to draw a Kaplan-Meier curve and I found online that Kaplan -
> Meier estimates are computed with a function called km in the event package.
> Is there an update for that because when I choose to download packages in
> R,. there is no package called event, even though I have selected all the
> repositories.
>
> Thanks in advance,
> Eleni
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



More information about the R-help mailing list