Skip to content

survfit question

3 messages · andre bedon, David Winsemius, Kevin E. Thorpe

#
On Sep 9, 2010, at 8:50 PM, andre bedon wrote:

            
It's not really the cdf of the KM since the KM is just an estimator.  
Yeah, I know, picky, picky.
I'm reasonably sure you need to assign that to something (unless its  
purpose is just to test the syntax.)
The survival function is just 1 minus the CDF, (and vice versa). You  
didn't provide any data, but we can use the aml dataframe in survival:

library(survival)
surv.all<-survfit(Surv(time,status)~1, data=aml)
str(surv.all)   # x-coord is "time" and S_KM(t) is "surv"
plot(surv.all$time, 1-surv.all$surv, type="s", ylim=c(0,1))

So that's the KM estimator of the CDF. Doesn't inherit the nice  
features of the plot.survfit function, though. It's also going to be  
more messy if you have two/+ groups
#
On 09/09/2010 08:50 PM, andre bedon wrote:
Do you really want a CDF or just plot 1-KM.  If you want to plot 1-KM, 
just fit your survival model as usual and plot() it with the plot 
argument fun="event".