Hello, I need to rank a numeric variable into 5 groups by another categorical variable and also get the cutoffs. I currently have this code:
proc rank data=dsout out=ranks groups=5; by var2; var var1; ranks var1_rank; run;
I have 2 columns now (var1, var2), and I want the output to be 4 columns. The var1 ranks by var2 (var1_rank) derived using the above code and the cutoff values (range) that would take a value like '0.0999254969 <= x1 < 0.1993986319' based on how the ranks are calculated. Thanks.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.