Statalist The Stata Listserver


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

st: graph comparing results of several models after -parmby-


From   Michael McCulloch <mm@pinest.org>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: graph comparing results of several models after -parmby-
Date   Tue, 17 Oct 2006 11:30:00 -0700

Hello,
MY PROJECT:
I am comparing several different regression models whose results I have saved using -parmby-, and then concatenated into one data set using dsconcat.

WHAT I HAVE DONE:
*run models, adjusted and unadjusted (thanks to Roger Newson's paper)
tempfile tf1 tf2
parmby "stcox tcm", lab saving (tf1, replace) idn(1) ids(Unadjusted) eform
parmby "stcox tcm stage", lab saving (tf2, replace) idn(2) ids(Adjusted) eform
dsconcat tf1 tf2
format estimate min* max* %8.2f
format p %8.2e
and when* forest plot comparing results (thanks to Scott Merryman)
encode ids, gen(Model)
twoway rcap min95 max95 Model if parmseq==1, horizontal msize(huge) ///
xtitle(Hazard Ratio and 95% Confidence Interval, margin(0 0 0 5)) ///
ytitle(Analysis Method) ylabel( 1 "Adjusted" 2 "Unadjusted", angle(h)) ///
|| scatter Model estimate if parmseq==1, msize(medlarge) legend(off)

WHAT I WOULD LIKE TO ACHIEVE:
How would I modify the rcap/scatter command so that I could adjust the vertical distance between plotted whisker bars?
How would I modify the ylabel specification so I could automate the labeling without manually typing "adjusted", "unadjusted", etc. (I'm planning to compare many different models.)





Best wishes,
Michael McCulloch


____________________________________

Michael McCulloch
Pine Street Foundation
124 Pine Street, San Anselmo, CA 94960-2674
tel 415.407.1357
fax 415.485.1065
email: mm@pinest.org
web: www.pinestreetfoundation.org

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