Bookmark and Share

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]

RE: st: RE: mean and sd of lagged variables


From   "Ben Hoen" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: mean and sd of lagged variables
Date   Fri, 29 Jul 2011 09:40:45 -0400

The " sample ado" to which I was referring was from the .help rolling:

webuse lutkepohl2, clear
tsset qtr
rolling mean=r(mean) median=r(p50), window(10): summarize inc, detail
list in 1/10

This cleared all of the variables from the working file and replaced them
with: start end mean median

I don't want to loose the variables in the working file, therefore was
thinking there would be a way to calculate the mean and sd using a command
not unlike .gen or .egen.

Somewhat tangentially, way back in early 2000s you wrote about a .ma
command.  Is that not working anymore?  (the mean I calculated above IS a
moving average.)

Ben

Ben Hoen
Principal Research Associate
Lawrence Berkeley National Laboratory
Office: 845-758-1896
Cell: 718-812-7589
[email protected]
http://eetd.lbl.gov/ea/emp/staff/hoen.html




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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