DATA Step, Macro, Functions and more

proc rank within ranks

Accepted Solution Solved
Reply
Contributor ZZB
Contributor
Posts: 40
Accepted Solution

proc rank within ranks

I already use the 'proc rank' to rank data based on criteria A, for example, stocks are ranked into 10 groups based on returns. Then I want to further rank the data within each group based on criteria B. How to rank such way in a dataset?

Thanks

  ID        DATE     A     B

109                      1     1

678                      1     2

567                      1     3

.....

189                      2     1

608                      2     2

597                      2     3

.....

489                      3     1

408                      3     2

997                      3     3

.....


Accepted Solutions
Solution
‎11-16-2014 12:04 PM
Regular Contributor
Posts: 184

Re: proc rank within ranks

Let var. A be a BY variable in the second PROC RANK call.

View solution in original post


All Replies
Solution
‎11-16-2014 12:04 PM
Regular Contributor
Posts: 184

Re: proc rank within ranks

Let var. A be a BY variable in the second PROC RANK call.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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