[R] Show number at risk on Kaplan Meier curve

Mark Wardle mark at wardle.org
Sun Dec 10 17:53:13 CET 2006


Frank E Harrell Jr wrote:

> 
> library(Design) # which also requires the Hmisc package
> f <- cph( ..., surv=TRUE)
> survplot(f, ..., n.risk=TRUE)
> 
> ?survplot for details
> 
> 


Thank you for the replies.

Both solutions perfectly - and I've now another package to experiment
with - so I'm very grateful!

My work is looking at natural history rather than the effects of an
intervention, so I'm not too worried about stopping the curves when
there are one or two long-lifers. I think that is a reasonable thing to
do anyway!

Best wishes,

Mark




More information about the R-help mailing list