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]

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


From   Tim Evans <Tim.Evans@wmciu.nhs.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to overlay four Cox survival curves in one graph
Date   Thu, 18 Apr 2013 10:58:16 +0100

Agnes,

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 

Hope this helps.

Best wishes

Tim


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of agnes cheah
Sent: 18 April 2013 10:42
To: statalist@hsphsun2.harvard.edu
Subject: st: How to overlay four Cox survival curves in one graph

Hi,

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).

Hope you can assist with this.

Thanks

Regards,
Agnes
*
*   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/

_DISCLAIMER:
This email and any files transmitted with it are confidential. If you are not the intended recipient, any reading, printing, storage, disclosure, copying or any other action taken in respect of this e-mail is prohibited and may be unlawful. If you are not the intended recipient, please notify the sender immediately by using the reply function and then permanently delete what you have received.
 
The information contained in this e-mail may be subject to public disclosure under the Freedom of Information Act 2000. The confidentiality of this e-mail and your reply cannot be guaranteed, unless the information is legally exempt from disclosure.


*
*   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