On Jan 24, 2004, at 2:33 AM, Adrian wrote:
And what I need is to take the standard deviation by country and for
every two consecutive quarters and store that number in the following
quarter. So, eventually, I will convert the dataset given in monthly
frequency (as shown) to quarterly frequency. I was thinking of taking,
by country and for every row, the standard dev of the previous six
observations, and then lag everything by three months and then collapse
everything into quarters. But I don't know how to take the std devs...
Something like this is what I could do, except that I know the -in-
part
is not syntactically correct:
by country: egen stdev = sd(xgrth) in xgrth[_n-5]/xgrth
any ideas?
The SSC routine mvsumm (Cox and Baum) does just that. ssc describe
mvsumm for details.
Kit
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/