So I have this sample data format
ID | Block | Value | WANT |
1 | A | -10 | 1 |
1 | A | 0 | 2 |
1 | A | 0.52 | 3 |
1 | A | 18 | 4 |
1 | A | 20 | 5 |
1 | A | 25 | 6 |
1 | b | -19 | 1 |
1 | b | 0.25 | 2 |
1 | b | 0.96 | 3 |
1 | b | 21 | 4 |
1 | b | 32 | 5 |
1 | b | 45 | 6 |
So I want to code a rank based on the values for each ID/block. All patients have 12 records (6 for block A and 6 for block B). So I did the first step where I used proc sort by ID Block and Value. Now I want to create that WANT variable where it indicates the rank within each ID/Block. What is the easiest way to do this?
Thanks!