Skip to content

Weibull survival regression

2 messages · Eric Lim, Thomas Lumley

#
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
#
On Tue, 23 Nov 2004, Eric Lim wrote:
That's because you read the part of the message where I got the 
reparametrization wrong, rather than the part where I got right.

It should be
  curve(pweibull(x, scale=exp(coef(lung.wbs)), shape=1/lung.wbs$scale,
       lower.tail=FALSE),from=0, to=max(lung$time))


 	-thomas