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

st: Bar chart and time series


From   Friedrich Huebler <huebler@rocketmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Bar chart and time series
Date   Thu, 26 May 2005 10:48:44 -0700 (PDT)

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.

Friedrich Huebler

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index