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   "Newson, Roger B" <r.newson@imperial.ac.uk>
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 16:34:02 +0100

To do this, have a separate -scatter- subgraph as the third subplot in
the series to add the labels to the upper confidence limits, as in

twoway rcap min95 max95 Model if parmseq==1, horizontal msize(huge)  ||
scatter Model estimate if parmseq==1, msize(medlarge) || scatter Model
max95, msym(none) mlabel(idstr) mlabpos(3) || , ytitle(Analysis Method)

or, alternatively, as in

eclplot estimate min95 max95 Model if parmseq==1, horizontal
estopts(msize(medlarge)) ciopts(msize(huge)) plot(scatter Model max95,
msym(none) mlabel(idstr) mlabpos(3)) ytitle(Analysis Method)

See help for -plot_option- to find more about plot options in general,
and help for -eclplot- to find how they might be used with -eclplot-.

I hope this helps.

Roger


Roger Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk 
www.imperial.ac.uk/nhli/r.newson/

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Michael
McCulloch
Sent: 19 October 2006 15:21
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>. I have seen in -whelp axis_label_options- that one can manually

specify text, but don't see how to specify text from a variable.
Michael


>In reply to your second query, the -ylabel()- option has a -valuelabel-
>suboption, allowing you to type
>
>ylabel(1 2, valuelabel)
>
>which should cause value labels to be printed.


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


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