OpenSourceAP / CrossSection

Code to accompany our paper Chen and Zimmermann (2020), "Open source cross-sectional asset pricing"
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3604626
GNU General Public License v2.0
738 stars 218 forks source link

Rev6 has very few observations #94

Closed chenandrewy closed 1 year ago

chenandrewy commented 2 years ago

Even in recent data, Rev6 is observed for only 10% of stocks image

Rev6 is just the 6-month moving average of eps forecast changes scaled by the most recent stock price. It shouldn't be missing this much, should it?

tomz23 commented 1 year ago

The issue can be traced to this line keep if fpedats != . & fpedats > statpers + 30

that drops observations very close to the forecast period end date. The panel is then very imbalanced, and the six-month lag cannot be calculated properly:

gen REV6 = tempRev + l.tempRev + l2.tempRev + l3.tempRev + l4.tempRev + l5.tempRev + l6.tempRev

I instead kept the observations but carried forward the last EPS forecast that happened at least 30 days ago, see 17c6578deeaa06e74b21b52925d5f4f75bcc4915

Does this sound good to you @chenandrewy ?

If so, feel free to close the issue.

chenandrewy commented 1 year ago

Sorry for the slow response. Your fix sounds good! Thanks!