Page 1 of 1

Divide group of stocks into quintiles

Posted: Tue Aug 16, 2022 4:19 pm
by Sima77
I have a group of 46 series/stocks that shows the monthly betas of the stocks and It looks like this:

......... stock1...stock 2 .......stock 46
2010m01...1.8...0.34............ 0.98
2010m02...0.55...0.20............0.43
.
.
2021m1... 0.11...0.65............ 0.79

I need to divide the stocks into quintiles based on beta values EVERY month, but I need the output to show me which stocks (stocks1, stock5, stock31...) are in each quintile (not only the beta values). Any programming suggestions?