[R] survfit question

Kevin E. Thorpe kevin.thorpe at utoronto.ca
Fri Sep 10 03:38:37 CEST 2010


On 09/09/2010 08:50 PM, andre bedon wrote:
>
> Hi,
>
>
>
> I am attempting to graph a Kaplan Meier estimate for some claims
> using the survfit function. However, I was wondering if it is
> possible to plot a cdf of the kaplan meier rather than the survival
> function. Here is some of my code:
>

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".

>
> library(survival) Surv(claimj,censorj==0)
> survfit(Surv(claimj,censorj==0)~1)
> surv.all<-survfit(Surv(claimj,censorj==0)~1) summary(surv.all)
> plot(surv.all) I would really appreciate any assistance. Thank you.
>
>
>
> Regards,
>
>
>
> Andre


-- 
Kevin E. Thorpe
Biostatistician/Trialist, Knowledge Translation Program
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: kevin.thorpe at utoronto.ca  Tel: 416.864.5776  Fax: 416.864.3016



More information about the R-help mailing list