Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: How to overlay four Cox survival curves in one graph


From   agnes cheah <agnesxie4@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: How to overlay four Cox survival curves in one graph
Date   Fri, 19 Apr 2013 09:09:13 +1000

Hi

Thanks  Tim and Nick. However, I am not sure which words I need to
replace with variable names or commands to draw the 4 curves in one
graph. Do I have to save the graphs into memory and call in out again
later?
Just to put it in context, I used these commands to plot Cox survival
curves each time after performing the stcox regression
stcurve, survival at 1(group=0 at 2(group=1)- plotted two lines based on group
stcurve, survival at 1(Drug=1) at 2(Drug=2)- plotted two lines based on Drug

Thank you

Agnes

On Thu, Apr 18, 2013 at 8:04 PM, Nick Cox <njcoxstata@gmail.com> wrote:
> This should work too, in the same example.
>
> line basesurvest* _t, connect(J ..) sort legend(order(1 "1" 2 "2" 3 "3"))
>
> Nick
> njcoxstata@gmail.com
>
> On 18 April 2013 10:58, Tim Evans <Tim.Evans@wmciu.nhs.uk> wrote:
>
>> Can you run -stcox- with and estimate the basesurv. You should then be able to construct your survival curves in one graph using something like this:
>>
>> forval i = 1/3 {
>> stcox if whatever==`i', estimate basesurv(basesurvest`i')
>> }
>>
>> line basesurvest1 _t, connect(J) sort || /*
>> */ line basesurvest2 _t, connect(J) sort || /*
>> */ line basesurvest3 _t, connect(J) sort
>
> agnes cheah
>
>> I have plotted two separate Cox survival curves (corresponding to two Cox models). How do I overlay the two plots (containing 2 curves, because stcurve, by variable command used) into one single graph)? I tried graph combine (not what I want) and addplot (does not seem to work).
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index