Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: annual and 3years average


From   "Fabian Brenner" <[email protected]>
To   [email protected]
Subject   st: annual and 3years average
Date   Wed, 17 Sep 2008 12:50:26 +0200

Dear all,

I have several observations called "ROE" for the "years" (from 1979 to 2006). There is a different number of observations for each year. 

My data look like this:
"year"   "ROE"      "Average"   "threeyearaverage"

79           12               ?                       ?      
79            9                ?                       ?
79            2                ?                       ?
80            3                ?                       ?
81            20              ?                       ?
81            5                ?                       ?
82            3                ?                       ?
82            6                ?                       ?
82            9                ?                       ?
82            8                ?                       ?
.               .                 .
.               .                 .
.               .                 .

I want to compute the average of the observations for each year, e.g. for 1979: (12+9+2)/3 (I tried to sort the observations and to divide the sum by _n but it didn't work...)
In a second step I want to get the average ROE for the past three years ("threeyearaverage") (beginning in 1982), e.g. for 1982 it should be the average of the ROE in 1979 plus the average ROE in 1980 plus average ROE in 1981, divided by 3.

I hope someone has an idea or a solution for this problem...Thanks a lot.
Fabian

-- 
Psssst! Schon vom neuen GMX MultiMessenger geh�rt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index