Message-ID: <457C0F18.9060005@vanderbilt.edu>
Date: 2006-12-10T13:43:52Z
From: Frank E Harrell Jr
Subject: Show number at risk on Kaplan Meier curve
In-Reply-To: <457B1115.3010701@wardle.org>
Mark Wardle wrote:
> Dear all,
>
> I'm using the "survival" package with R 2.4.0 on Mac OS X 10.4.8.
>
> I have two core statistics books (one of which is Altman's medical stats
> book) which suggest showing the number of individuals at risk at
> different time intervals on the Kaplan-Meier curve.
>
> My plot shows two curves that later cross, because of one significant
> outlier.
>
> I have two queries:
>
> Is there an easy way of displaying number of individuals at risk at a
> specific time interval?
>
> Is there a way to stop plotting when the number of individuals at risk
> reaches a certain minimum threshold to reduce the risk of such an
> outlier problem?
>
> If there is no easy solution, then I suppose I shall have to perform the
> logic myself, calculating when individuals "drop out", and overlaying
> that onto the plot?
>
> Many thanks,
>
> Mark
>
library(Design) # which also requires the Hmisc package
f <- cph( ..., surv=TRUE)
survplot(f, ..., n.risk=TRUE)
?survplot for details
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University