----- Original Message -----
From: "Clara Soh" <[email protected]>
To: <[email protected]>
Sent: Friday, May 09, 2003 3:53 PM
Subject: st: Moving Average
> Is there a way to force Stata to calculate a moving average using an EVEN
number? I am trying to calculate ma() over several years, and a 12 month
moving ave. makes the most sense.
>
>
> thanks
> clara
>
>
I take you are using -egen-, have you looked at -tssmooth_ma-. Something
like:tssmooth ma foo_ma = foo, window(12) would produce a 12 lagged period
moving average. The window option allows you to vary the lags and the
forward terms.
There are also several ideas for calculating moving averages in the FAQ at
http://www.stata.com/support/faqs/stat/moving.html that might be useful.
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/