BookmarkSubscribeRSS Feed
jaxonmills
Calcite | Level 5

Let's say I have the following data on firm size, profitability, and stock returns. The firms are sorted into terciles according to size and profitability like so:

ObsSize_TercileProfitability_TercileStock_Return
111.12
211.03
312.21
412.37
513.14
613.07
721.19
822.17
922.06
1022.11
1123.42
1223-.13
1331.03
1431.05
1532.22
1633-.16
............

What's the most efficient way to program a double sort? I want to get average returns for the intersection of each size tercile with each profitability tercile:


Average Stock Returns sorted by firm size and profitability


Profitability Terciles <->
Size Terciles \/ \/123
1.........
2.........
3.........

I'm looking for efficiency here because this process will be repeated for several different variables sorted not necessarily by just terciles. Thanks in advance.

2 REPLIES 2
LinusH
Tourmaline | Level 20

I'm not sure if I got the picture clear, but PROC SUMMARY using CLASS is usually very efficient.

/Linus

Data never sleeps
yotsuba88
Quartz | Level 8

Hi Jaxonmills,

 

Have you solve this problem? Please share with me, I am working on it now but I havenot found the solution for it.

 

Thank you very much.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1729 views
  • 0 likes
  • 3 in conversation