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]

st: combination of rolling and if


From   qing ye <yeqing1013@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: combination of rolling and if
Date   Wed, 14 Dec 2011 05:08:16 +0800

Dear statalist

I am a bit confused with combining the rolling and if.

what does the following commend do?

I have monthly panel data, variables are

stock, date, return, ST


for the following code
rolling mean=r(mean), windows (12): sum return if ST=1, detail

Did it, for every month, take observations whose 'ST'=1 and then
calculate mean return for this group of stocks over the next 12
months? This is what I wanted to do.

Or, did it, for every month, take all the observations in the next 12
months, and calculate mean returns of all the observation for which
'ST'==1?

Thanks for your help

Qing
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index