Statalist The Stata Listserver


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

st: RE: ytitle suboption -valuelabel-: how to label using the text from a variable


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: ytitle suboption -valuelabel-: how to label using the text from a variable
Date   Thu, 19 Oct 2006 09:57:38 -0500

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Michael McCulloch
> Sent: Thursday, October 19, 2006 9:21 AM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: ytitle suboption -valuelabel-: how to label using the text
> from a variable
> 
> Roger, I'm sorry I wasn't clear in my question.
> Now I realize that what I would like to do is label each of the -rcap-
> whisker bars from the graph below with the text contained in a variable
> <idstr>. 

<snip>

Do you mean something like this?

clear
input str6 method es lci uci
    Cox   .89   .86   .99 
    MSM   1.2   .95   1.5 
 Pscore   .31   .22   .51 
 end
 l
 gen pos = 6
 replace pos = 12 if meth == "Cox"
encode method, gen(meth)

twoway rcap lci uci meth, horizontal msize(huge) /// 
xtitle(Hazard Ratio and 95% Confidence Interval, margin(0 0 0 5)) /// 
ytitle(Analysis Method) ylabel(none)  ///
 || scatter meth es, msize(medlarge) legend(off) /// 
 || scatter meth es, mlabel(meth) mlabsize(large) /// 
 mlabvpos(pos) mlabgap(2) msymbol(none)


Scott



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