s-news
[Top] [All Lists]

Re: [S] Survival Analysis : 1 - KM curve

To: Cecile.Delhumeau@hcuge.ch
Subject: Re: [S] Survival Analysis : 1 - KM curve
From: "Therneau, Terry M., Ph.D." <therneau@mayo.edu> (Terry Therneau)
Date: Tue, 29 Feb 2000 08:36:21 -0600
Cc: s-news@wubios.wustl.edu
Sender: owner-s-news@wubios.wustl.edu

  As has already been pointed out, a plot of the cumulative probability
of death, 1 - Kaplan-Meier, can be obtained in the newer releases using
the "fun" argument to plot:

   fit <- survfit(Surv(time, status) ~ 1, data=lung)
   plot(fit, fun='event')

The argument is very general, for instance fun=sqrt would plot on a square
root scale.

  For older versions there is a trick that can be used-- modify rows of the
data object:

   fit$surv <- 1-fit$surv
   fit$upper <- 1-fit$upper
   fit$lower <- 1-fit$lower
   plot(fit, xlim= range(fit$time))

The xlim argument cuts off the extra point (time=0, surv=1) that is usually
added by the plot routine.

        Terry Therneau
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [S] Survival Analysis : 1 - KM curve, Therneau, Terry M., Ph.D. <=