Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: Adding a bar for total in bar graph over category


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Adding a bar for total in bar graph over category
Date   Fri, 9 Apr 2010 10:24:50 +0100

Here's a work-around on a similar problem. 

sysuse auto, clear
preserve 
expand 2
replace foreign = 2 in 75/L
label def origin 2 "Total", add
graph bar (mean) mpg, over(foreign)
restore 

Your equivalent of 75 will be 1 more than the number of observations in your dataset. 

Nick 
n.j.cox@durham.ac.uk 

Mehtabul Azam

I have a categorical variable area (Urban & Rural), and i am making a
bar graph over(area). poor is indicator for being poor.
i want to add a bar for total (Urban & Rural). However, over
suboptions does not seem to have anything which add a bar for total
also.
graph bar (mean) poor [aw=weight], over(area) over(year)
Is there a way to add up a bar for total (with urban and rural categories)?

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