Hi all,
I need some help. I want to compute the value-weighted average return for the applicable portfolio in 25 portfolios formed each fiscal year (variable FYEAR) by first sorting firms (GVKEY) into quintiles based on the beginning market value of equity (SIZEtm1), and then sorting each of these quintiles into quintiles based on the beginning book-to-market equity ratio (MTBtm1). The share price variable for each firm is PRCC_F.
Thank you very much!
Thierry
Making quintiles will be the easy part.
But before we get to that:
You are apparently forming 25 new portfolios each year. Are you bringing forward holdings of the equivalent portfolio from the end of the previous year? (Is that what you mean by value weighted?). What is the timing of annual rebalancing? By that I mean are you using price at the beginning of the fiscal year and book value from the end of the prior fiscal year, (i.e. 1 day earlier)? Even though that book value won't be published until the next quarterly or annual filing 6 weeks or more later?
And don't forget, with Compustat data (whicih uses GVKEY as the company identifier), you'll have to account for stock splits.
You can start to answer these questions by providing a working data step with sample data.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.