Search code examples
sasrankproc

sas ranking starts from zero


I have an var which I need to rank=> by 4 groups in accordance to the quadrilles of this var. which means I need to have total of ranks: 1,2,3,4 for some reason when I do the proc rank my ranking starts from 0, and not 1

proc rank data=comb out=comb1 groups=4; 
var educ;
ranks new_educ;
run;

How can I make it start from 1/rename rankings ?


Solution

  • There is no option within proc rank that allows you to do this, so you will need to run an additional data step or create a view which adds 1 to new_educ to do what you want.