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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1552 views
  • 0 likes
  • 3 in conversation