First, have you tried -search-? It can point you in the right direction.
For example -search legend- brings up (with a hyperlink):
[G] legend_option . . . . . . . . . . . Option for specifying legend
(help legend_option)
For these questions,
1. legend(off) will suppress the legend.
2. There is an option within -xtitle()- called -margin()- that will increase
the space around a textbox.
With these options you would have:
clear
input str6 method es lci uci
Cox .89 .86 .99
MSM 1.2 .95 1.5
Pscore .31 .22 .51
end
l
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( 1 "Cox" 2 "MSM" 3 "Pscore" , angle(h)) ///
|| scatter meth es, msize(medlarge) legend(off)
3. This is not really programming - all we are doing is calling two graph
command, -twoway rcap- and -scatter-.
There are several sources to learn Stata programming:
1. Net courses, which Kevin Crow (kcrow@stata.com) just announced two
upcoming courses
2. User manual, Programming Guide, and Maximum Likelihood Estimation with
Stata
3. The Stata Journal, especially the columns "Speaking Stata" by Nick Cox
and "Mata Matter" by Bill Gould.
4. The Statalist
5. The recent Stata Press books "An Introduction to Modern Econometrics
Using Stata" by Kit Baum and "Data Analysis Using Stata" by Ulrich Kohler
and Frauke Kreuter both contain a chapter on basic Stata programming.
You might also find this recent thread useful:
http://www.stata.com/statalist/archive/2006-09/msg00550.html
Scott
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Michael McCulloch
> Sent: Thursday, September 21, 2006 4:21 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: RE: summarizing several analyses in one graph
>
> Works beautifully, Scott!
> Three short questions, if I may:
> 1. How can I suppress the legend, which now shows: <capped bar> "lci/uci"
> <red dot> "meth".
> 2. Can the xtitle be made to sit lower down? It bumps up against the x-
> axis
> label numbers.
> 3. Is this Stata programming language? Where can I learn how to write such
> elegent code? Right now, I'm only at the "do-file" level.
> Thank you very much,
> Michael
*
* 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/