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, 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 <>
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

Thanks for your help

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index