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   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: graphing the averages of a variable by year
Date   Mon, 12 May 2003 10:20:39 +0100

Matias Barenstein 

> 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.

In Stata 7 or Stata 8, you can do this without creating 
a data set. 

egen mean = mean(whatever), by(year) 
egen tag = tag(year) 

<graphics_command> mean year if tag 

I am not clear what a two-way table with dots is. 

 
Nick
[email protected]
*
*   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