Re: [R] Survival statistics--displaying multiple plots

From: Gregory Pierce <pierce.gregory_at_gmail.com>
Date: Thu, 03 May 2007 00:09:35 -0400

Thanks for replying Robert. Forgive me, it might be the hour or my limitations, but I am a little unclear on how to implement your suggestion.

In my original example,

>plot(survfit(Surv(days,status==1),subset(tips,meld<10))

A plot of the fraction of patients surviving following the procedure against the number of days since the procedure would be generated for patients with meld scores of less than 10.

Similarly, if I wanted to generate a survival curve of patients with scores of between 10 and 20, I can with the following:

 >plot(survfit(Surv(days,status==1),subset(tips,meld>10 & meld <20))

And for patients with meld>20,

>plot(survfit(Surv(days,status==1),subset(tips,meld>20))

But how do I display the curves in each cadre (meld<10, 10<meld<20, and meld>20) on the same chart?  

-----Original Message-----
From: Robert A LaBudde [mailto:ral_at_lcfltd.com] Sent: Wednesday, May 02, 2007 11:48 PM
To: Gregory Pierce
Subject: Re: [R] Survival statistics--displaying multiple plots

? layout()
? par()

E.g.,

layout(matrix(c(1,2,3),1,3,byrow=TRUE) #3 plots side-by-side

Then use plot() three times to generate each of your graphs.

At 11:14 PM 5/2/2007, Greg wrote:
>I should clarify. I can generate plots for each category individually but
>not for all three on the same chart.
>
>Greg
>
>-----Original Message-----
>From: Gregory Pierce [mailto:pierce.gregory_at_gmail.com]
>Sent: Wednesday, May 02, 2007 10:21 PM
>To: 'r-help_at_stat.math.ethz.ch'
>Subject: Survival statistics--displaying multiple plots
>
>Hello all!
>
>I am once again analyzing patient survival data with chronic liver disease.
>
>The severity of the liver disease is given by a number which is
continuously
>variable. I have referred to this number as "meld"--model for end stage
>liver disease--which is the result of a mathematical calculation on
>underlying laboratory values. So, for example, I can generate a
Kaplan-Meier
>plot of patients undergoing a TIPS procedure with the following:
>
> >plot(survfit(Surv(days,status==1),subset(tips,meld<10))
>
>where "tips" is my data set, "days" is the number of days alive, and meld
is
>the meld score.
>
>What I would like to do is display the survival graphs of patients with
>meld<10, 10<meld<20, and meld>20. I am unsure about how to go about this.
>
>Any suggestions would be appreciated.



Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral_at_lcfltd.com
Least Cost Formulations, Ltd.            URL: http://lcfltd.com/
824 Timberlake Drive                     Tel: 757-467-0954
Virginia Beach, VA 23464-3239            Fax: 757-467-2947

"Vere scire est per causas scire"



R-help_at_stat.math.ethz.ch 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 Thu 03 May 2007 - 04:15:20 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 03 May 2007 - 05:31:44 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.