Good day dear All,
I am new here. Taking SAS courses and have a question regarding the Rank procedure. The thing is, when I'm using it my ranking values are not integres.
I want to rank the goals quantities in order to find the second highest values of each category.
proc rank data=LaLiga out=rankings;
var goals;
ranks result;
proc print data=rankings;
run;
why it doesn't work here?
thanks in advance.
I want to rank the goals quantities in order to find the second highest values of each category.
If "category" means Position, then you want to make position a BY variable.
proc sort data=have;
by position;
run;
proc rank data=have out=rankings descending ties=low;
by position;
var goals;
ranks goals_ranked;
run;
As stated, you will have to figure out which option of TIES= works best for you.
If you don't care about ties, then just sort the data by position and goals, and take the 2nd record for each position.
Thank you.
I want to rank the goals quantities in order to find the second highest values of each category.
If "category" means Position, then you want to make position a BY variable.
proc sort data=have;
by position;
run;
proc rank data=have out=rankings descending ties=low;
by position;
var goals;
ranks goals_ranked;
run;
As stated, you will have to figure out which option of TIES= works best for you.
If you don't care about ties, then just sort the data by position and goals, and take the 2nd record for each position.
Thank you for your help.
proc rank data=have out=rankings descending ties=dense;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Ready to level-up your skills? Choose your own adventure.