Statalist The Stata Listserver


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

RE: st: RE: combining graphs


From   "Maarten Buis" <M.Buis@fsw.vu.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: combining graphs
Date   Tue, 25 Jul 2006 11:47:07 +0200

Monika:
You can generate a variable containing the survivor function using -sts gen- and than use -twoway- to create graphs that superimpose the survivor function on some other graph, see the (nonsensical) example below:

*---------begin example---------
sysuse cancer, clear
stset studytime, failure(died)
sts gen survivor = s
twoway scatter age _t || line survivor _t, c(J) sort yaxis(2) clstyle(p1)
*--------end example-------------

HTH,
Maarten

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

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

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

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Monika Huembelin
Sent: dinsdag 25 juli 2006 11:33
To: statalist@hsphsun2.harvard.edu
Subject: AW: st: RE: combining graphs

Sorry maybe my problem description was a little bit too sketchy. I don't want to stratify the data. I have graphs with different stset variables and failure variables which I'd like to sort of superimpose in one single graph. Or even combine lets say a histogram with a survival curve if that is possible at all. I hope I didnt make it more confusing. Thanks a lot.

Monika

----- Urspr√ľngliche Mail ----
Von: Maarten Buis <M.Buis@fsw.vu.nl>
An: statalist@hsphsun2.harvard.edu
Gesendet: Dienstag, den 25. Juli 2006, 10:20:21 Uhr
Betreff: st: RE: combining graphs


Monika:
I am assuming you want to show the survival curves of different groups in the same graph, is that correct? In that case you can use the by-option of the -sts graph- command, see example below:

*------begin example-----
sysuse cancer, clear
stset studytime, failure(died)
sts graph, by(drug)
*-------end example------

HTH,
Maarten

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

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

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

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Monika Huembelin
Sent: dinsdag 25 juli 2006 9:21
To: statalist@hsphsun2.harvard.edu
Subject: st: combining graphs

Hello everyone,

I'd like to combine survival curves of different graphs in a single graph. With the "graph combine" command I just get a graph with subgraphs. Does anyone know if this is possible at all and if you can even combine graphs of different types? Thanks a lot for helping a STATA greenhorn using STATA 8.2.

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

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

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

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index