Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Replicating catplot with twoway parea


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Replicating catplot with twoway parea
Date   Thu, 17 Dec 2009 00:33:25 -0800 (PST)

--- On Thu, 17/12/09, jasonm@ucla.edu wrote:
> How do I replicate catplot using twoway parea?

That requires major data surgery, so unless it means the 
difference between publish or not publish, I would not 
bother. Anyhow, the example below should get you started.

Notice that -catplot- is not in offical Stata, and that
you are asked to report where you retrieved a user written
program from. I got mine from SSC (-ssc install catplot-).

*-------------- begin example ------------------
sysuse auto, clear
catplot hbar foreign

contract foreign
gen y1 = foreign - .25
gen y2 = foreign + .25
expand 2
bys foreign: replace _freq = 0 if _n==2
list
twoway rarea y1 y2 _freq if foreign == 0, ///
       fcolor(gs12) ||                    ///
       rarea y1 y2 _freq if foreign == 1, ///
       fcolor(gs12) legend(off)           ///
       ylab(0 "domestic" 1 "foreign")     ///
       ytitle("") xtitle("frequency")
*----------------- end example -------------------	   
( For more on how to use examples I sent to statalist see:
 http://www.maartenbuis.nl/stata/exampleFAQ.html )

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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