Hi 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? 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> version_ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 1.1 year 2005 month 06 day 20 language R>Many thanks S. ???? ?"? ???? ???? http://mail.nana.co.il [[alternative HTML version deleted]]
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
Thanks Regards Stephen ________________________________ From: Prof Brian Ripley [mailto:ripley@stats.ox.ac.uk] Sent: Tue 22/11/2005 10:15 To: Stephen Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Weibull and survival 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@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 ???? ?"? ???? ???? http://mail.nana.co.il [[alternative HTML version deleted]]
Hi Excellent diagnosis we have zero survival times Unfortunately no MASS4 p. 380 - I can't locate - help appreciated. Thanks S. ________________________________ From: Prof Brian Ripley [mailto:ripley@stats.ox.ac.uk] Sent: Tue 22/11/2005 10:15 To: Stephen Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Weibull and survival 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@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 ???? ?"? ???? ???? http://mail.nana.co.il [[alternative HTML version deleted]]