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]

st: combination of rolling and if


From   qing ye <[email protected]>
To   [email protected]
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index