Ranking is a statistical transformation that can be used on Numeric and Ordinal data that replaces the source values in the data with their rank value after being sorted. Consider this readership data set below: This article describes how to go from:
To a state where ranking within variable will apply the rank transformation for each column in the data to yield the following:
- A Displayr document containing Numeric and Ordinal data.
To use this transformation:
- Select one or more questions that are Numeric and Ordinal variable or variable sets in the Data Sets tree.
- Still in the Data Sets tree, hover where you want to insert the new variable, then click the + button to select Ready-Made New Variables > Scale Variable(s) > Ranks Within Variable.
- OPTIONAL: If your document contains more than one data file you will be prompted to select the data file. Click OK.
- Next, you will be asked to select the variable sets you want to transform, click OK.
- A new numeric R variable is created with ranking within the variable.
For Numeric variables, the ranking is determined with the smallest value in the variable taking the rank of 1, the second-smallest taking the rank of 2, and so on until the values have been ranked. If there are any ties in the data, then they share the average rank. For Nominal or Ordinal variables, a similar procedure applies except that the categorical value attribute labels are mapped to the source numeric values to determine the ranking.
Scale Variable(s) to Ranks Within Case
Article is closed for comments.