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: Average of previous years


From   emanuele mazzini <[email protected]>
To   [email protected]
Subject   st: Average of previous years
Date   Sat, 9 Apr 2011 17:29:56 +0200

Dear stata users,

i do have the following problem in generating a new variable: I need
to generate a variable which takes the value of the average values of
the five preceding years of another variable that I have in my
dataset.
In other words, supposing my new variable is y at time t, I need that
its value is equal to the average of another variable (say x) from t-1
to t-5.

Since I am just beginning in using Stata anyone knows how can I deal
with this or find any help?

Thank to all of you in advance,
Regards,
Emanuele.
*
*   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