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

Re: st: Moving Average


From   Robert A Yaffee <[email protected]>
To   [email protected]
Subject   Re: st: Moving Average
Date   Sat, 10 May 2003 11:07:48 -0400

Robert A. Yaffee, Ph.D.
Senior Research/Statistical Consultant
Statistics and Social Science Group
Information Technology Services
Academic Computing Services
New York University
251 Mercer Street
New York, New York, 10012
phone: (1)212-998-3402
fax: (1)212-995-4120
e-mail: [email protected]
        [email protected] 
Office location: 75 Third Avenue
                           Level C-3
                           New York, NY 10003

----- Original Message -----
From: Clara Soh <[email protected]>
Date: Friday, May 9, 2003 4: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
> 
> 
> *
> *   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/
> 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/



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