Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Calculating Averages of Each Observation for Panel Data


From   Andrew Wong Yoon Loong <[email protected]>
To   [email protected]
Subject   st: Calculating Averages of Each Observation for Panel Data
Date   Thu, 24 Nov 2011 14:47:14 -0500

Hi Statalisters,

I am working with panel data that is similar to the following:

Station Year    Month    V1     V2
1         1990    1             25      25
1         1990    5             60      12
1         1990    7              0       .
1         1991    1              .       .
1         1991    6            300     50
2         1990    1             25      25
2         1990    5             60      12
2         1990    7             0       .
2         1991    1              .       .
2         1991    6             300     50

Is there a command in STATA that will allow me to calculate the annual
average values for V1 and V2 for each individual station such that I
will get a dataset resembling the one below? Or do I have to manually
calculate using the average() function in Excel?

Station Year    V1      V2
1         1990
1         1991
2         1990
2         1991

Thank you in advance for your help.

Regards
Andrew

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index