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: RE: question on graphing a bar


From   Jian Zhang <[email protected]>
To   [email protected]
Subject   Re: st: RE: question on graphing a bar
Date   Fri, 18 May 2012 22:37:56 +0800

Each bar represents the mean of the variable in the sample.


On Fri, May 18, 2012 at 10:35 PM, Nick Cox <[email protected]> wrote:
> If you don't ask the real question, you may not get the real answer.
>
> This still isn't clear to me: How is each variable going to produce one and only one bar?
>
> Nick
> [email protected]
>
> Jian Zhang
>
> Nick, it works. but what  i have is a data set of three variables, say
> non-earned income, wage_income and self-employment income. what i
> wanted is a bar chart where there is one bar for non-earned income,
> then one bar for wage_income and one bar for self-employment income
> but the two later bars were stacked. Note that all the observations
> have values for the three variables. So it is not possible to use the
> option of over.  Is there a way to graph a bar like this with the
> data?
>
> On Fri, May 18, 2012 at 10:05 PM, Nick Cox <[email protected]> wrote:
>> Consider
>>
>> clear
>> set obs 3
>> gen cat = _n
>> gen twothree = _n > 1
>> gen y = runiform()
>> graph bar (asis) y , over(cat) over(twothree) asyvars stack
>>
>> Nick
>> [email protected]
>>
>> Jian Zhang
>>
>> I was trying to graph a vertical bar chart where there are three bars.
>> but i wanted the second and third bars stacked. Does anyone know how
>> to do this? thanks!
>>
>
> *
> *   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/



-- 
Jian Zhang(张舰)
Assistant Professor
School of Economics
Central University of Finance and Economics, Beijing, China 100081
Email: [email protected]
Cell Phone: 86 - 137 188 65377
Web Page: http://econ.cufe.edu.cn/html/2010-07-16/312.html

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