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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Ready to level-up your skills? Choose your own adventure.