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

Re: st: graphing the averages of a variable by year


From   Buzz Burhans <[email protected]>
To   [email protected]
Subject   Re: st: graphing the averages of a variable by year
Date   Mon, 12 May 2003 07:23:07 -0400

Mat,

One possibility which quickly and temporarily creates the "separate'" yearly averaged data (note that "collapse" could also use weights if needed):

preserve

collapse var, by(year)

scatter var year

restore


Buzz Burhans


At 03:52 PM 5/11/03 -0700, you wrote:

Hello, I was wondering if there is a straightforward
way to do the following.  I have 40 years of data, and
I want to graph the average of a variable by year.  I
was looking at the graphics manual, but it only seems
that the bar graph allows for this.  However, I would
rather do a two-way table with dots (not a bar graph).
 Is there a simple way to do this?

I suppose one can do it by creating a separate data
set with the averages by year, but I was hoping there
might be a simpler way without having to resort to
that.

Thank you very much for your help,
Mat


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.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/
*
*   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