Previous Page | Next Page

The RANK Procedure

Example 1: Ranking Values of Multiple Variables


Procedure features:

PROC RANK statement options:

DESCENDING

TIES=

RANKS statement

VAR statement

Other features:

PRINT procedure


This example performs the following actions:


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
data cake;
   input Name $ 1-10 Present 12-13 Taste 15-16;
   datalines;
Davis      77 84
Orlando    93 80
Ramey      68 72
Roe        68 75
Sanders    56 79
Simms      68 77
Strickland 82 79
;
 Note about code
proc rank data=cake out=order descending ties=low;
 Note about code
   var present taste;
   ranks PresentRank TasteRank;
run;
 Note about code
proc print data=order;
   title "Rankings of Participants' Scores";
run;

Output: Listing

                        Rankings of Participants' Scores                       1

                                                    Present    Taste
           Obs    Name          Present    Taste      Rank      Rank

            1     Davis            77        84        3         1  
            2     Orlando          93        80        1         2  
            3     Ramey            68        72        4         7  
            4     Roe              68        75        4         6  
            5     Sanders          56        79        7         3  
            6     Simms            68        77        4         5  
            7     Strickland       82        79        2         3  

Previous Page | Next Page | Top of Page