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: RE: Adding a bar for total in bar graph over category


From   "Nick Cox" <[email protected]>
To   <[email protected]>
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 
[email protected] 

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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index