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]

Re: st: graph bar, over() with overall mean


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: graph bar, over() with overall mean
Date   Thu, 30 Jan 2014 11:04:47 -0600

Yes, by creating an additional category:

sysuse auto,clear
set obs 76
replace rep = 6 in 75/76
replace fore = 0 in 75
replace fore = 1 in 76
sum mpg if fore == 1 & rep != 6
replace mpg = r(mean) if fore == 1  & rep == 6
sum mpg if fore ==0 & rep != 6
replace mpg = r(mean) if fore == 0  & rep == 6

graph bar (mean) mpg, over(rep78)  over(foreign) asyvars legend(off)

Scott
*
*   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