[R] Weibull and survival

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Nov 22 09:15:43 CET 2005


On Tue, 22 Nov 2005, Stephen wrote:

> I have been asked to provide Weibull parameters from a paper using
> Kaplan Meir survival analysis.
>
> This is something I am not familiar with.
>
> The survival analysis in R works nicely and is the same as commercial
> software (only the graphs are superior in R).
>
> The Weibull does not and produces an error (see below).
>
> Any ideas why this error should occur?

Do you have zero survival times?  They cannot occur for a Weibull, but
might as a result of rounding.

For a worked example of how to deal with these, see MASS4 p. 380.

The other possibility is that you have infinite survival times, but that 
is unlikely to be correct ....


> My approach may be spurious.
>
> Code follows
>
> #The following works fine
>
>> surv.mod1 <- survfit( Surv(SURALL2, relall6==1)~randgrpc,
> type=c("kaplan-meier"),data=Dataset)
>
> #The following works produces the error below
>
>> surv.mod2 <- survreg( Surv(SURALL2, relall6 == 1)~randgrpc,
> data=Dataset, dist="weibull")
>
> Error in survreg(Surv(SURALL2, relall6 == 1) ~ randgrpc, data = Dataset,
> :
>
>        Invalid survival times for this distribution

> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list