Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[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 <jack.knife@live.fr>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index