Statalist The Stata Listserver


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

Re: st: Graph help needed - superimposing two series within the same graph


From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Graph help needed - superimposing two series within the same graph
Date   Mon, 24 Apr 2006 09:15:02 +0200

Ashwin wrote:

I have two outcomes - outcome1 and outcome2. I have
the same three categories for each outcome - low,
middle and high. Each category has an odds ratio and a
95% confidence interval.

I would like to creat a graph with the category (low,
mid, high) on the X-axis and the odds ratio on the
Y-axis - the odds ratio being represented by a small
box/symbol in the center with the 95% CI as a vertical
line (similar to a box and whiskers plot - only
without the 25th and 75th percentile shoulders).

...

I'm using intercooled Stata 8.0.
-------------------------------------------------------------

First: You should update to Stata 8.2 - it is free.

Does the following do what you want? Note that I modified the x-variable
(cat) to avoid overlapping.

clear
input cat outc or cil ciu
1 1 2.0 1.4 2.8
2 1 1.5 1.0 2.25
3 1 1.6 1.3 2.1
1 2 3.0 2.0 4.5
2 2 2.5 2.0 3.1
3 2 2.0 1.4 2.8
end

replace cat=cat-0.02 if outc==1
replace cat=cat+0.02 if outc==2

twoway                               ///
   (scatter or cat if outc==1)        ///
   (rspike cil ciu cat if outc==1)    ///
   (scatter or cat if outc==2)        ///
   (rspike cil ciu cat if outc==2)


Svend
__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796
Email: sj@soci.au.dk
__________________________________________

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