Re: [R] error bars on survival curve

From: Frank E Harrell Jr <>
Date: Sun, 17 Jun 2007 09:38:39 -0500

Murray Pung wrote:
> I am using plot(survfit(Surv(time,status) ~...) and would like to add
> error bars rather than the confidence intervals. Am I able to do this
> at specified times? e.g. when time = 20 & 40.
> leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml)
> plot(leukemia.surv, lty = 2:3,xlim = c(0,50))
> #can i add error bars at times 20 & 40?
> legend(100, .9, c("Maintenance", "No Maintenance"), lty = 2:3)
> Thanks
> Murray

Error bars when done correctly should equal confidence intervals in the minds of many.

When the Design package is available again for the latest version of R, you can have more control using the survplot function, with bars and bands options. Do ?survplot.survfit


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

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 17 Jun 2007 - 15:11:57 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 Sun 17 Jun 2007 - 17:31:54 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.