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

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

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

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,

[hidden email] mailing list
PLEASE do read the posting guide!