07-26-2017 03:34 PM
Please help! I want to Rank the second variable in this code.
input id region;
proc sort data = have;
if first.id then rank =1;
ID Rank1 Rank2
10 1 1
10 2 1
10 3 2
07-26-2017 03:38 PM
What is your rule for ranking a character variable?
Since you have US within 3 of the ID groups it isn't clear what that rule may be.
Also you might want to work the result for all of your example data and not remove the Region variable.
07-26-2017 03:46 PM
Thank you, My rule is to Rank a new column when the variable is US, Another Column to Rank, for CA separately and one column with no rules.(which I already got it from the prev query)
Need further help from the community? Please ask a new question.