BookmarkSubscribeRSS Feed
tritringuyen
Quartz | Level 8

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

1 REPLY 1
mkeintz
PROC Star

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.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 833 views
  • 0 likes
  • 2 in conversation