Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: tssmooth: nb of nonmissing observations used in the moving average computation
From
Jack Knife <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: tssmooth: nb of nonmissing observations used in the moving average computation
Date
Mon, 24 Jun 2013 13:45:47 +0200
Dear all,
I would like to use the tssmooth ma function in stata,
but I may have some missing values in my dataset (xtsetted by panel and
time).
According to the manual, tssmooth ignores the missing values
and gives them a weight of 0. It is thus possible to obtain how many
values (actually)
were used to compute a single moving average value?
For instance, I would like to obtain the moving average with lags -55 to -6 so I run
tssmooth ma newvar=oldvar, weights(1 1 1 1 1 1 1 1 1 1 ///
1 1 1 1 1 1 1 1 1 1 ///
1 1 1 1 1 1 1 1 1 1 ///
1 1 1 1 1 1 1 1 1 1 ///
1 1 1 1 1 1 1 1 1 1 ///
1 1 1 1 1 0 0 0 0 0 <0>)
}
many thanks
Jack K.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/