27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Basic Specification<br />

RANK 1321<br />

The basic specification is VARIABLES and at least one variable from the working data file. By<br />

default, the ranking function is RANK. Direction is ascending, and ties are handled by assigning<br />

the mean rank to tied values. A summary table that lists the ranked variables and the new<br />

variables into which computed ranks have been stored is displayed.<br />

Subcommand Order<br />

• VARIABLES must be specified first.<br />

• The remaining subcommands can be specified in any order.<br />

Operations<br />

Example<br />

• RANK does not change the way the working data file is sorted.<br />

• If new variable names are not specified with the INTO keyword on the function subcommand,<br />

RANK creates default names. (See the INTO keyword on p. 1323.)<br />

• RANK automatically assigns variable labels to the new variables. The labels identify the<br />

source variables. For example, the label for a new variable with the default name RSALARY<br />

is RANK of SALARY.<br />

RANK VARIABLES=SALARY JOBTIME.<br />

• RANK ranks SALARY and JOBTIME and creates two new variables in the working file,<br />

RSALARY and RJOBTIME, which contain the ranks.<br />

VARIABLES Subcommand<br />

VARIABLES specifies the variables to be ranked. Keyword VARIABLES can be omitted.<br />

• VARIABLES is required and must be the first specification on RANK. The minimum specification<br />

is a single numeric variable. To rank more than one variable, specify a variable<br />

list.<br />

• After the variable list you can specify the direction for ranking in parentheses. Specify A<br />

for ascending (smallest value gets smallest rank) or D for descending (largest value gets<br />

smallest rank). A is the default.<br />

• To rank some variables in ascending order and others in descending order, use both A and<br />

D in the same variable list. A or D applies to all preceding variables in the list up to the<br />

previous A or D specification.<br />

• To organize ranks into subgroups, specify keyword BY followed by the variable whose<br />

values determine the subgroups. The working data file does not have to be sorted by this<br />

variable.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!