Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4

Reminder: You can use the ATTRIB, FORMAT, LABEL, and WHERE statements. See Chapter 3, Statements with the Same Function in Multiple Procedures, on page 57 for details. You can also use any global statements. See Global Statements on page 18 for a list.

PROC RANK < option(s) >;

To do this

Use this statement

Calculate a separate set of ranks for each BY group

BY

Identify a variables that contain the ranks

RANKS

Specify the variables to rank

VAR

PROC RANK Statement

PROC RANK < option(s) >;

To do this

Use this option

Specify the input data set

DATA=

Create an output data set

OUT=

Specify the ranking method

 
 

Compute fractional ranks

FRACTION or NPLUS1

 

Partition observations into groups

GROUPS=

 

Compute normal scores

NORMAL=

 

Compute percentages

PERCENT

 

Compute Savage scores

SAVAGE

Reverse the order of the rankings

DESCENDING

Specify how to rank tied values

TIES=

Note: You can specify only one ranking method in a single PROC RANK step.

Options

DATA= SAS-data-set

DESCENDING

FRACTION

GROUPS= number-of-groups

NORMAL=BLOM TUKEY VW

NPLUS1

OUT= SAS-data-set

PERCENT

SAVAGE

TIES=HIGH LOW MEAN

BY Statement

Produces a separate set of ranks for each BY group.

Main discussion: BY on page 58

Featured in: Example 2 on page 839 and Example 3 on page 841

BY <DESCENDING> variable-1

Required Arguments

variable

Options

DESCENDING

NOTSORTED

RANKS Statement

Creates new variables for the rank values.

Requirement: If you use the RANKS statement, you must also use the VAR statement.

Default: If you omit the RANKS statement, the rank values replace the original variable values in the output data set.

Featured in: Example 1 on page 837 and Example 2 on page 839

RANKS new-variables(s) ;

Required Arguments

new-variable (s)

VAR Statement

Specifies the input variables.

Default: If you omit the VAR statement, PROC RANK computes ranks for all numeric variables in the input data set.

Featured in: Example 1 on page 837, Example 2 on page 839, and Example 3 on page 841

VAR data-set-variables(s) ;

Required Arguments

data- set-variable (s)

Using the VAR Statement with the RANKS Statement

The VAR statement is required when you use the RANKS statement. Using these statements together creates the ranking variables named in the RANKS statement that correspond to the input variables specified in the VAR statement. If you omit the RANKS statement, the rank values replace the original values in the output data set.

Категории