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: overlay of stacked bar and line?


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: overlay of stacked bar and line?
Date   Thu, 27 Feb 2014 23:27:57 +0000

As Sergiy explains, as does the manual, -graph bar- is not of the same
family as -twoway-.

You could think of some variant on

gen Y2 = y1 + y2
gen Y3 = Y2 + y3
gen Y4 = Y3 + y4

twoway bar y1 year || rbar y1 Y2 year || rbar Y2 Y3 year || rbar Y3 Y4 year

Nick
njcoxstata@gmail.com


On 27 February 2014 22:24, Nirina F <fstata@gmail.com> wrote:
> I am trying to graph a yearly data and the first one below worked but
> not quite what I wanted as I wanted the bar to be stacked.
>
> twoway  bar  y1 y2 y3 y4 year  if year>=2000 || line totalofy1y2 year
> if year>=2000
>
> Then I tried this but I got an error I believe it does not specify the
> overlay....
>
> graph bar (asis)  y1 y2 y3 if year>=2000, over(year) stack || line
> totalofy1y2 year
>
> Is there a new command that does this please?
*
*   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