[R] Kaplan Meier function

Frank E Harrell Jr f.harrell at vanderbilt.edu
Thu Feb 14 18:57:42 CET 2008


Matthias Gondan wrote:
> Frank E Harrell Jr schrieb:
>> Matthias Gondan wrote:
>>>> 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?
>> That's one of many options in the survplot function in the Design 
>> package, which uses the survival package.
> 
> Ah, thanks! Nice.
> 
> data(colon)
> s = survfit(Surv(time, status) ~ rx, data=colon)
> survplot(s, n.risk=TRUE, conf='none', time.inc=500)
> 
> Is there an option for drawing small vertical lines if a patient has 
> been censored?

No, I haven't been a big enough fan of that to implement it.  You can 
write a few lines of code that runs after survplot().

Frank

> 
> Best wishes,
> 
> Matthias
> 
> ______________________________________________
> 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.
> 


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list