Re: [R] Problem plotting curve on survival curve

From: Calum <>
Date: Mon, 03 Mar 2008 23:24:00 +0000

Terry Therneau wrote:
> It is easier to get survival curves using the predict function. Here is a
> simple example:

>> tfit <- survreg(Surv(time, status) ~ factor(ph.ecog), data=lung)
>> tdata <- data.frame(ph.ecog=factor(0:3))
>> qpred <- predict(tfit, newdata= tdata, type='quantile', p=1:99/100)
>> matplot(t(qpred), 99:1/100, type='l')


Many thanks - that worked at treat... (One day I might work out what it does - for now I'm happy it does it!) In terms of when I write up what I did is this still a weibull regression? help(predict.survreg) just calls it a quantile... (Sorry that may be dumb question ;-) )

> The above fit assumed a common shape for the 4 groups,
> you can add a "+ strata(ph.ecog)" term to have a separate scale for each group;
> this would give the same curves as 4 separate fits to the subgroups.

Any thoughts on which is scientifically more valid? I'd have thoughts 4 separate shapes? Certainly if I'm modeling drugs - its surely possible that a new drug might change the course of disease and therefore the shape of the curve altogether?

Brings me back to my extra question - is there any way to determine quality of the fit for this (like an R^2 value for a linear regression).   That might answer if a strata approach is needed. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 03 Mar 2008 - 23:41:40 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 Tue 04 Mar 2008 - 00:30:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive