Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Moving Average


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Moving Average
Date   Fri, 9 May 2003 16:26:42 -0500

----- Original Message -----
From: "Clara Soh" <csoh@health.nyc.gov>
To: <statalist@hsphsun2.harvard.edu>
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/



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