----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Sunday, October 26, 2003 1:01 PM
Subject: st: 5-years period averages
> Dear Statalisters,
> To avoid temporary external shocks effects, I have restructure my balanced
> panel data in a 5-years averages. I used the following program so far but now
> that I want to try the data set in 3-years averages, I found it to be a pain
> if I should type in the full numlist as before.
> I would appreciate therefore any suggestion that avoids me typing the numlist.
I'm not sure I follow, but if you want a 5 or 3 year moving average you could
use -tssmooth ma-
For example, using the Grunfeld data set (webuse grunfeld) a 5 year average for
each variable could be obtained by:
foreach var of varlist invest-kstock {
tssmooth ma ma5_`var' = `var', window(4 1)
}
Scott
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/