Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: moving average of the last 55 time points

From   Maarten Buis <>
Subject   Re: st: moving average of the last 55 time points
Date   Mon, 30 Jan 2012 10:13:40 +0100

On Mon, Jan 30, 2012 at 9:45 AM, Juan Fernandez  wrote:
> I am trying to obtain moving averages that take into account the
> previous 55 time points (in this case, years) in a panel data setting.
<snip> -tssmooth ma, window()- doesn't do it  either because it is
> limited in the number of lags it can consider.

That limit is explained in the help-file:

        #l specifies the number of lagged terms to be included,
        0 < #l < one-half the number of observations in the sample.

This makes sense to me. If you specified a larger lag than the window
cannot move, which is a fundamental characteristic of a _moving_
average. The logic of smoothers is that you do _not_ want to use all
information, but only information from observations that are close.
The definition of "close" determines your tradeoff between "smooth but
wrong" and "true but rough".

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index