A rank variable represents the ordering of the values of a numeric variable. Because ranks are the cornerstone of many nonparametric statistical methods, it is useful to know how to compute the rank transform of a variable in your dataset.
In SPSS, rank variables can be computed using the Rank Cases procedure. To open Rank Cases, click Transform > Rank Cases.
A Variables: The variables to compute rank transforms on. The new ranks will be saved to new variables (whose names will be automatically generated).
B By: (Optional) Assign ranks within groups. By variables should be nominal or ordinal, and have a small number of categories.
C Assign Rank 1 to: Should ranks be assigned in increasing or decreasing order? By default, ranks are assigned by ordering the data values in ascending order (smallest to largest), then labeling the smallest value as rank 1. Alternatively, Largest value orders the data in descending order (largest to smallest), and assigns the largest value the rank of 1.
D Display summary tables: When checked, a summary of the new rank variables is printed to the Output window. The summary includes the original variables, the name of the new variables, the rank order, the ranking method, and the method used for ties. This option is on by default.
E Rank types: (Optional) Choose one or more formulas to compute the ranks. Each box you check on this screen will add another rank variable to your dataset.
By default, only the "Rank" option is selected; this computes simple ranks. For details about the other rank types and the proportion estimation formulas, please see the official SPSS documentation for Rank Cases. Note that the Proportion Estimation Formula options are inactive unless Proportion estimates and/or Normal scores are selected.
F Ties: How should ranks be assigned in the case of ties? (A tie occurs when two or more observations share the exact same value.) There are four options for how to resolve ties: Mean, Low, High, and Sequential ranks to unique values. By default, mean ranks are assigned to ties.
Many hypothesis tests require assumptions about the distribution of the data or residuals. A common way to adjust for non-normality is to perform a transform on that variable; for example, taking the log, square root, or square of a variable. Rank transforms are another type of transform. Suppose we want to perform a rank transform on a variable in the sample dataset that is non-normally distributed: MileMinDur.
Before we compute the ranks, let's check how many nonmissing values MileMinDur has. Let's also check the distribution of the mile run times graphically. The Frequencies procedure makes it easy to do both of these things at once:
There are two important things we want to take note of:
This means that after we run the Rank Cases procedure, the resulting variable will only have assigned ranks for the 392 cases with nonmissing mile run times.
RANK VARIABLES=MileMinDur (A) /RANK /PRINT=YES /TIES=MEAN.
After executing the procedure, SPSS will add a new variable at the end of your dataset, and will print a table summarizing the computation in the Output window:
This table summarizes what the Rank Cases procedure did. It created a new variable named RMileMin, and assigned it the variable label "Rank of MileMinDur". It ranked the values in ascending order (i.e., the smallest value has rank 1), and it used the mean rank for values with ties.
We can inspect the new variable using the Descriptives procedure to get the sample size, minimum, maximum, mean, and standard deviation of the new variable:
Notice that we have the same sample size as the original variable (392).