[R] survreg and pweibull

From: Andrew Beckerman <a.beckerman_at_sheffield.ac.uk>
Date: Wed, 26 Nov 2008 16:27:02 +0000

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.


Using the lung data set,

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:


Many thanks for the clarification....

R version 2.8.0 (2008-10-20)
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


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

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 26 Nov 2008 - 16:30:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Nov 2008 - 11:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive