[R] survreg and pweibull

Andrew Beckerman a.beckerman at sheffield.ac.uk
Wed Nov 26 17:27:02 CET 2008


Dear all -

I have followed the thread the reply to which was lead by Thomas  
Lumley about using pweibull to generate fitted survival curves for  
survreg models.

http://tolstoy.newcastle.edu.au/R/help/04/11/7766.html

Using the lung data set,

data(lung)
lung.wbs <- survreg( Surv(time, status)~ 1, data=lung, dist='weibull')
curve(pweibull(x, scale=exp(coef(lung.wbs)), shape=1/lung.wbs 
$scale,lower.tail=FALSE),from=0, to=max(lung$time))
lines(survfit(Surv(time,status)~1, data=lung), col="red")

Assuming this is correct, why does the inflection point of this curve  
not match up to the exp(scale parameter)?  Am I wrong in assuming that  
the scale represents the inflection, and the shape adjusts the shape  
around this point?  I think I am.... perhaps confusing the scale and  
the median with the inflection point calcuation?

One can visualise the mismatch with:

abline(v=exp(coef(lung.wbs)),lty=2)
abline(h=0.5,lty=2)

Many thanks for the clarification....

R version 2.8.0 (2008-10-20)
i386-apple-darwin8.11.1
locale:
en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8
attached base packages:
[1] splines   datasets  utils     stats     graphics  grDevices  
methods   base
other attached packages:
[1] survival_2.34-1 Hmisc_3.4-3     lattice_0.17-15 MASS_7.2-44
loaded via a namespace (and not attached):
[1] cluster_1.11.11 grid_2.8.0      tools_2.8.0

Andrew

---------------------------------------------------------------------------------
Dr. Andrew Beckerman
Department of Animal and Plant Sciences, University of Sheffield,
Alfred Denny Building, Western Bank, Sheffield S10 2TN, UK
ph +44 (0)114 222 0026; fx +44 (0)114 222 0002
http://www.beckslab.staff.shef.ac.uk/

http://www.flickr.com/photos/apbeckerman/
http://www.warblefly.co.uk



More information about the R-help mailing list