Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Bar chart and time series


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Bar chart and time series
Date   Thu, 26 May 2005 20:59:59 +0100

This seems in essentially the same territory
as Margo Schlanger's question yesterday and 
so my answer resembles the one given to her. 

I am not clear what your "guidelines" are, 
but they sound like a boss with inflexible 
views. Anyway, I am pretty clear that -graph bar- 
was never really intended for time series data. 

Given some preternatural predisposition to a
bar chart here, you should go straight for 
-twoway bar- here, and forego the categorical 
imperative, here so much cant (Kant?). 

Nick 
[email protected] 

Friedrich Huebler
 
> Stata 8.2, Windows XP
> 
> I would like to create a bar chart that compares country data over
> time but am not sure how to do this. Take this example:
> 
> . sysuse educ99gdp, clear
> . graph bar public private, over(country)
> 
> The graph shows 1999 data. Now assume that I have 2004 data that I
> want to add to the graph. Assume further that all 2004 values are
> higher than the 1999 values.
> 
> . gen public04 = 1.2*public
> . gen private04 = 1.2*private
> 
> One possibility would be to add the 2004-1999 difference on top of
> the existing bars, in a stacked bar chart. Another possibility would
> be to add points or other symbols above the "public" and "private"
> bars that indicate the 2004 value. I don't know how to do either in
> Stata and so far I managed only to create a graph that has too many
> bars.
> 
> . graph bar public public04 private private04, over(country)
> 
> I studied the Graphics manual and Michael Mitchell's "A visual guide
> to Stata graphics" but found no other solution. Dot plots are not an
> option because I have to follow certain guidelines. Thank you for
> your suggestions on how the data could be presented.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index