Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: sts graph by option and totals[Scanned]


From   "Patrick Woodburn" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: sts graph by option and totals[Scanned]
Date   Thu, 11 Jan 2007 17:27:14 +0300

Thank you, Maarten, that worked very well.  Problem solved!

Patrick 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maarten Buis
Sent: 11 January 2007 17:17
To: [email protected]
Subject: st: RE: sts graph by option and totals[Scanned]

--- Patrick Woodburn asked: 
> Is there any way to plot a survival plot across a total dataset on the

> same graph as survival time plots divided across the values of a 
> particular variable?

You can use -sts gen- to create variables containing the values of the
survival functions, and then graph those, like in the example below:

Hope this helps,
Maarten

*----------- begin example ----------
sysuse cancer, clear
stset studytime, failure(died)
sts gen tsurv = s
sts gen bsurv = s, by(drug)
twoway line bsurv _t if drug==1, sort ||        /*
    */ line bsurv _t if drug==2, sort ||        /*
    */ line bsurv _t if drug==3, sort ||        /*
    */ line tsurv _t, sort                      /*
    */ xtitle("analysis time")                  /*
    */ ytitle("")                               /*
    */ title("Kaplan-Meier survival estimates") /*
    */ legend(label(1 "placebo")                /*
    */        label(2 "drug 2" )                /*
    */        label(3 "drug 3" )                /*
    */        label(4 "total"  ) )
*------------- end example ----------


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
This message (and any associated files) is intended only for the use of 
the individual or entity to which it is addressed and may contain 
information that is confidential, proprietary, subject to copyright or 
constitutes legally privileged information. If you are not the 
intended recipient you are hereby notified that any dissemination, 
copying, printing or distribution of this message, or files associated with 
this message, is Illegal. If you have received this message in 
error, please notify us immediately by replying to the message and 
deleting it from your computer. Medical Research Council reserves the right 
to monitor all communications through its networks. Any views expressed 
in this message are those of the individual sender, except 
where the message states otherwise and the sender states them to be the 
views of any such entity.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index