[R] plot.survfit and cloglog

gb gb at stat.umu.se
Thu Jun 8 18:58:42 CEST 2000


With R-1.0.1, Linux RH6.2 and survival5, I try

> x2.fit <- survfit(Surv(stopp, event) ~ x2)
> plot(x2.fit, fun = "cloglog")
Error in rep(2, n2 - 1) : invalid number of copies in "rep"
In addition: Warning message: 
1 x value <= 0 omitted from logarithmic plot in: xy.coords(x, y, xlabel,
ylabel, log) 

(an empty plot area pops up), also

> print(x2.fit)
Call: survfit(formula = Surv(stopp, event) ~ x2)

      n events mean se(mean) median 0.95LCL 0.95UCL
x2=0 52     23 3.19    0.514  2.277   0.839     Inf
x2=1 48     40 0.69    0.173  0.282   0.169    0.66
Warning message: 
no finite arguments to min/max; returning extreme. in: min(..., na.rm =
na.rm) 

seem to indicate something strange. However, 'fun="cumhaz"' works as
expected. Is this a bug, or am I doing something stupid (again)? 

I tried to replicate this with a small data set:
> t1
 [1] 1.233 0.391 0.219 0.420 0.710 1.658 1.487 2.888 0.175 0.045
> ev
 [1] 1 1 1 1 1 1 1 1 1 1

> fit <- survfit(Surv(t1, ev) ~ 1)
> plot(fit, fun = "cloglog")
Error in rep(2, n2 - 1) : invalid number of copies in "rep"
In addition: Warning message: 
1 x value <= 0 omitted from logarithmic plot in: xy.coords(x, y, xlabel,
ylabel, log) 

However, this time a plot (apparently correct) shows up.

Göran

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list