Rachel Pearce
2005-Sep-19 09:59 UTC
[R] Problem with tick marks in lines.survfit (package survival)
I have attempted to follow posting guidelines but I have failed to find out what I am doing wrong here. I am trying to use lines.survfit to plot a second curve onto a survival curve produced by plot.survfit. In my case this is to be a progression free survival curve superimposed upon an overall survival curve, but I will illustrate my problem using the example given in the help for lines.survfit. I would like to have tick marks for censored data points on both curves, so I would like to do something like: > fit <- survfit(Surv(time, status) ~ sex, pbc,subset=1:312)> plot(fit[2], mark.time=TRUE, xscale=365.24,+ xlab='Years', ylab='Survival')> lines(fit[1], lwd=2, xscale=365.24, mark.time=TRUE)but when I do this, no tick marks appear on the second curve. Can anyone see what I am doing wrong here? Rachel [[alternative HTML version deleted]]
Rachel Pearce
2005-Sep-19 12:05 UTC
[R] Problem with tick marks in lines.survfit (package survival) Improved message
Sorry, my previous email seems to have come through in a rather odd format. Also I forgot to add version and OS information, now included below. My original query was: I have attempted to follow posting guidelines but I have failed to find out what I am doing wrong here. I am trying to use lines.survfit to plot a second curve onto a survival curve produced by plot.survfit. In my case this is to be a progression free survival curve superimposed upon an overall survival curve, but I will illustrate my problem using the example given in the help for lines.survfit. I would like to have tick marks for censored data points on both curves, so I would like to do something like:> fit <- survfit(Surv(time, status) ~ sex, pbc,subset=1:312) > plot(fit[2], mark.time=TRUE, xscale=365.24,+ xlab='Years', ylab='Survival')> lines(fit[1], lwd=2, xscale=365.24, mark.time=TRUE)but when I do this, no tick marks appear on the second curve. Can anyone see what I am doing wrong here? Rachel Here are the version data: platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 1.1 year 2005 month 06 day 20 language R
Robert Baer
2005-Sep-19 14:13 UTC
[R] Problem with tick marks in lines.survfit (package survival)
How about: plot(fit, mark.time=TRUE, xscale=365.24,xlab='Years', ylab='Survival',lwd=c(2,1)) Rob ----- Original Message ----- From: "Rachel Pearce" <pearce.rachel at gmail.com> To: <r-help at stat.math.ethz.ch> Sent: Monday, September 19, 2005 4:59 AM Subject: [R] Problem with tick marks in lines.survfit (package survival)> I have attempted to follow posting guidelines but I have failed to findout> what I am doing wrong here. > I am trying to use lines.survfit to plot a second curve onto a survival > curve produced by plot.survfit. In my case this is to be a progressionfree> survival curve superimposed upon an overall survival curve, but I will > illustrate my problem using the example given in the help forlines.survfit.> I would like to have tick marks for censored data points on both curves,so> I would like to do something like: > > fit <- survfit(Surv(time, status) ~ sex, pbc,subset=1:312) > > plot(fit[2], mark.time=TRUE, xscale=365.24, > + xlab='Years', ylab='Survival') > > lines(fit[1], lwd=2, xscale=365.24, mark.time=TRUE) > but when I do this, no tick marks appear on the second curve. Can anyone > see what I am doing wrong here? > Rachel > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html>