Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Two by two stacked bars

From   "Margo Schlanger" <[email protected]>
To   <[email protected]>
Subject   st: Two by two stacked bars
Date   Wed, 25 May 2005 17:52:48 -0500

I want to create a single bar graph presenting the means of four
variables for each of four years, stacked 2x2.

My five variables are:  old new oldpop newpop year.  I can easily get
two different stacked graphs:

graph bar (mean) old new  over(year) stack 
graph bar (mean) oldpop newpop over(year) stack 

What I want to do, though, is have these all appear on one graph, with
old and new stacked in one color, and oldpop and newpop stacked in
another color, with those stacked bars grouped by year.  I can get
something close by creating an "old+new" variable and an "oldpop+newpop"
variable, and then graphing those by year.  But I want the information
from the stacks, too, and all I've been able to do, so far, is put them
in different colors and then combine them with grc1leg or graph

Any suggestions?  


Margo Schlanger
Professor of Law
Washington University in St. Louis
One Brookings Drive
Campus Box 1120
St. Louis, MO  63130
(314) 935-8242
[email protected]
*   For searches and help try:

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