survival with Weibull

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

survival with Weibull

Remigijus Lapinskas
Hello,

I want to test if the Weibull distribution is appropriate for the
failure time. When trying to reproduce an example from MASS (the book,
Ch. 13.2), I type

library(survival)
library(MASS)
leuk.wei <- survreg( Surv(time)~ag+log(wbc),data=leuk)
ntimes <- leuk$time*exp(-leuk.wei$linear.predictors)
plot(survfit(Surv(ntimes)),log=T)

and get (almost) the same graph as in the book (which means that the
distribution is close to exponential). On the other hand, if I want to
test for the Weibull distribution, the recommended command

> plot(survfit(Surv(ntimes)),fun="cloglog")

ends in an error message:

Error in rep.default(2, n2 - 1) : invalid number of copies in rep()
In addition: Warning message:
2 x values <= 0 omitted from logarithmic plot in: xy.coords(x, y,
xlabel, ylabel, log)

I'd appreciate any hints,
Rem

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html