Statalist


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

st: Standard deviation of a moving window


From   Ari Dothan <[email protected]>
To   [email protected]
Subject   st: Standard deviation of a moving window
Date   Fri, 21 Aug 2009 17:05:22 +0300

Hi all,
I am new to Stata, and will appreciate your help.
I have a variable called "M" in a longitudinal panel containing firms'
data over years.
To calculate "Uncertainty" for all firms in year T, I need to
calculate the standard deviation of "M" in years T-1, T-2 and T-3. In
Year T+1, I will have to calculate the st dev of "M" in years T, T-1
and T-2, and so on. An "if" statement will require to check whether
this next row reflects the same firm or not by checking if
FirmNumber_T=FirmNumber_T-1=FirmNumber_T-2 and so on.
I could not find answer in the documentation I saw.
Please help
Thanks

Ari Dothan
-- 
Ari Dothan

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