Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Stacked and Unstacked Variables in Graph Bar


From   Hendrik Worschech <[email protected]>
To   [email protected]
Subject   st: Stacked and Unstacked Variables in Graph Bar
Date   Fri, 19 Apr 2013 20:16:52 +0200

Hi,

I have a panel with, lets say, 10 individuals over 5 years and three
variables (a, b & c).

I would like to have the sum (of all individuals) of a & b stacked
together as one bar and the sum of c by itself next to it. And this
should be repeated for each year.

I've come across this example, but in my case I don't want to separate
by observations but by variables. I don't know how I could separate
the variables a&b from c with over:

webuse union, clear
keep idcode year age
gen which = cond(year == 71 | year == 77, 1, cond(year == 88, 2, .))
graph bar age, over(year) over(which) asyvars stack


Thank you for you help!
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index