Skip to content
Prev 59677 / 398502 Next

Weibull survival regression

A big thank you to everyone who responded...

Using Ales Ziberna solution with the lung dataset, I obtained:
Error in Surv(time, status) : Time variable is not numeric
In addition: Warning message: 
is.na() applied to non-(list or vector) in: is.na(time)


Using Thomas Lumley's solution with the lung dataset, I obtained:
lower.tail=FALSE),from=0, to=max(lung$time))

A Weibull survival plot appearing as a 90 degree `L' at the extremes of
the plot

I managed to obtain the solution by combining the two solutions:

lung.wbs <- survreg( Surv(futime, status)~ 1, data=lung, dist='weibull')

plot (survfit(Surv(futime,status)~1, data=lung))

curve (exp (- (exp( lung.wbs$coef[1])*x)^(1/lung.wbs$scale)),
col="black", add=T, from=0, to=30)

Kind regards,

Eric Lim
Papworth Hospital 
Cambridge, UK