From what I have comprehend from the question, you need the mean of var2 and var3 for each of the ranks 0,1,2 and 3. With this as the basis, the code would be like this. You are grouping based on the numeric values of the percentage data myd1; input var1 var2 var3 var4; datalines; 1 200 300 55 2 400 750 20 3 400 400 90 4 800 320 98 5 500 200 80 6 600 400 71 7 900 900 22 8 1000 9580 77 9 100 3000 42 10 760 1750 53 ; run; proc rank data=myd1 groups=4 out=want ; var var4; ranks groups; run; proc means data=want Mean maxdec=2; class groups; var var2 var3; run;
... View more