Statalist The Stata Listserver

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

RE: st: RE: summarizing several analyses in one graph

From   "Scott Merryman" <>
To   <>
Subject   RE: st: RE: summarizing several analyses in one graph
Date   Thu, 21 Sep 2006 16:55:51 -0500

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:

input str6 method es lci uci
    Cox   .89   .86   .99 
    MSM   1.2   .95   1.5 
 Pscore   .31   .22   .51 
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 ( just announced two
upcoming courses 

2. User manual, Programming Guide, and Maximum Likelihood Estimation with

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:


> -----Original Message-----
> From: [mailto:owner-
>] On Behalf Of Michael McCulloch
> Sent: Thursday, September 21, 2006 4:21 PM
> To:
> 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:

© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index