In this example, you
want to rank the students in your class by age and height.
To create this example:
-
In the
Tasks section,
expand the
Data folder, and then double-click
Rank
Data. The user interface for the Rank Data task opens.
-
On the
Data tab,
select the
SASHELP.CLASS data set.
Tip
If the data set is
not available from the drop-down list, click
. In the
Choose a Table window,
expand the library that contains the data set that you want to use.
Select the data set for the example and click
OK.
The selected data set should now appear in the drop-down list.
-
Assign columns to these
roles:
Role
|
Column Name
|
Roles
|
Columns
to rank
|
Height
|
Additional Roles
|
Rank by
|
Age
|
-
Open the
Options tab.
From the
Rank order drop-down list, select
Largest
to smallest.
-
To run the task, click
.
The Rank Data task creates
an output data set. In SAS Studio, this data set opens on the Output
Data tab. This data set contains the additional rank_Height
column, which shows where that student ranks within her age group.
For example, in the 11-year-old age group, Joyce is ranked number
2. In the 12-year-old age group, Louise is ranked number 5.