Re: [R] Strang line while plotting failure curves

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Thu, 06 Nov 2008 12:21:43 -0600

Lu, Jiang wrote:
> Dear R helper,
>
> I encountered a problem when I tried to plot the cumulative failure rate
> (i.e. 1 - survival probability). I have used the following code to plot. The
> scenario is that patients are randomized to different treatment arm (rev in
> the code), the PCI revascularization was monitored over 5 years.
>
> #R code
> testfit <- survfit(Surv(pcifu,pci)~rev,data=subproc)
> testfit$surv <- 1 - testfit$surv
> testfail <- plot(testfit, mark.time=FALSE,col=1:2, main='Failure Rate')
> #End of R code
>
> I arbitarily replaced testfit$surv by computing 1 minus the original
> survival rate. So far so good. However, when I plot the manipulated
> "testfit", there is a vertical line plotted at x=0, y=0:1. I checked
> testfit$time and testfit$surv, nothing weird there. I am very confused where
> the vertical line at starting point of time 0 came from. How can I get rid
> of it?
>
> Would you pleae help me with this? Thanks a lot!
>
> Jiang
>

Also see the survplot.* functions in the Design package and their fun argument, e.g., fun=function(y)1-y

Frank

> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 06 Nov 2008 - 18:31:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Nov 2008 - 21:30:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive