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 <jian32@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: question on graphing a bar
Date   Fri, 18 May 2012 22:30:30 +0800

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?

Jian

On Fri, May 18, 2012 at 10:05 PM, Nick Cox <n.j.cox@durham.ac.uk> 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
> n.j.cox@durham.ac.uk
>
> 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: jian32@gmail.com
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