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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: Re: st: rolling moments


From   annoporci <annoporci@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: Re: st: rolling moments
Date   Mon, 24 Dec 2012 21:28:47 +0800

For the record, this is what I ended up doing:

 webuse ibm
 tsset t
 local variables ibm
 foreach var of varlist `variables' {
   drop if missing(`var')
rolling `var'mu=r(mean) `var'sd=r(sd) `var'sk=r(skewness) `var'kt=r(kurtosis) /// , window (60) stepsize(1) saving(tmpfile,replace) keep(t): summarize `var', detail
}

--
Patrick Toche.
*
*   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