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

st: calculation problem

To   "statalist" <>
Subject   st: calculation problem
Date   Mon, 26 Nov 2007 22:08:39 +0100

Dear friends, I need a little help to solve a calculation. 
I have a panel database (cs and ts), and for one variable, say "x", I need to calculate the following formula:

y = summation_(i= t-2 to t) of (1/3)* abs[( x_i - x_i-1 )/ x_i-1 ]

In other words, "y" is the three-year average variation in % of "x". I would get a new column for each firm-year data. Could anybody help me? Thanks in advance!


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index