[R] Survival Plot in R 2.10.0

mah harwood262 at gmail.com
Fri Nov 6 20:16:37 CET 2009


I would like to produce a complimentary log-log survival plot with
only the points appearing on the graph.  I am using the code below,
taken from the plot.survfit page of help for the the survival package
(version 2.35-7).

I am running in R 2.10.0 on Windows XP, and the list of packages
following
the error is loaded.  Is there some specific 'type= ' syntax, or an
additional parameter
that I must specify?

> leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml)
> plot(leukemia.surv, lty = 2:3)                      ## works fine
> plot(leukemia.surv, lty = 2:3, fun="cloglog")       ## works fine
> plot(leukemia.surv, type="p")                       ## generates error below:

Error in plot.default(tempx, tempy * yscale, type = "n", log =
logax,  :
  formal argument "type" matched by multiple actual arguments

> search()
 [1] ".GlobalEnv"        "package:survival"  "package:splines"
 [4] "package:stats"     "package:graphics"  "package:grDevices"
 [7] "package:utils"     "package:datasets"  "package:methods"
[10] "Autoloads"         "package:base"

I can get a plot of points using plot(log(leukemia.surv$time),log(-log
(leukemia.surv$surv)), type="p"), but then I lose the functionality of
grid().  Ulimately what I want to do is overlay these plotted points
with lines generated
by various parametric survival models (dist=weibull, lognormal, etc).

All help is appreciated.  Thanks in advance!




More information about the R-help mailing list