Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Question About Bar Graph Axes and Graph Combine


From   njcoxstata@gmail.com
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Question About Bar Graph Axes and Graph Combine
Date   Thu, 20 Jun 2013 18:24:15 +0100

You might think about restructuring your data to one response variable, an -over()- variable and a -by()- variable.

Nick
njcoxstata@gmail.com

On 20 Jun 2013, at 15:57, Erika Kociolek <ekociole@gmail.com> wrote:

> I would like to show to two different changes over time by a group
> variable using horizontal bar graphs. I'd like to combine the bar
> graphs so they are in the same plot.
> 
> graph hbar changeovertime, over(group) ytitle("Change1 Over Time", size(small))
> save ../Graphs/Change_1.gph, replace
> graph hbar changeovertime2, over(group) ytitle("Change2 Over Time", size(small))
> save ../Graphs/Change_2.gph, replace
> 
> graph combine save ../Graphs/Change_1.gph save ../Graphs/Change_2.gph
> 
> When I run this code, the combined graph has the values of the group
> variable on the horizontal axis twice - one for the first graph, and
> one for the second. The group categories are exactly the same, so I am
> wondering if there a way to only list the values of the group variable
> on the first graph. Thank you for any advice you can provide.
> 
> Best,
> Erika
> *
> *   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index