
From  Scott Cunningham <scunning@gmail.com> 
To  statalist@hsphsun2.harvard.edu 
Subject  Re: st: creating bar charts 
Date  Fri, 24 Mar 2006 14:06:22 0500 
I have three variables: sexratio, age and race. Age takes on seven different values: 1, 5, 10, 15, 20, 25, and 30. Race takes on two value: 1 (white) and 2 (black). Sex ratio is the national ratio of on nonincarcerated men to women for each race and each age cohort (where "age cohort" refers to fiveyear gaps in age. So, "5" is 15 year olds, "10" is 610, and so on).
I'm trying to create a simply bar graph, and I've got it working for the most part, but I need to change a few things. Here's what I have so far:
. graph bar (asis) SexRatio, over(race) over(age) bargap(.80) legend ( label(1 "White") label(2 "Black") ) ytitle(Sex Ratio) title (Racial Dynamics in the U.S. Sex Ratio) note("Source: 2000 Census longform Summary File")
I thought that by changing the legend labels, it would actually report "white" and "black" instead of "1" and "2". But it doesn't. I'm not sure what exactly I did, then, by changing the legend in this way. There's no legend showing up, for instance, to the right of the graph if it was creating a legend.
Secondly, I wanted to make an xtitle, showing the reader that age was along the xaxis in fiveyear brackets, but when I included an  xtitle(Age) I got an error. Any ideas?
sc
*
* 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/
* * 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–2020 StataCorp LLC  Terms of use  Privacy  Contact us  What's new  Site index 