Instatistics,ranking is thedata transformation in whichnumerical orordinal values are replaced by their rank when the data are sorted.
For example, the ranks of the numerical data 3.4, 5.1, 2.6, 7.3 are 2, 3, 1, 4.
As another example, the ordinal data hot, cold, warm would be replaced by 3, 1, 2. In these examples, the ranks are assigned to values in ascending order, although descending ranks can also be used.
Ranks are related to the indexed list oforder statistics, which consists of the original dataset rearranged into ascending order.
Some kinds ofstatistical tests employ calculations based on ranks. Examples include:
The distribution of values in decreasing order of rank is often of interest when values vary widely in scale; this is therank-size distribution (or rank-frequency distribution), for example for city sizes or word frequencies. These often follow apower law.
Some ranks can have non-integer values for tied data values. For example, when there is an even number of copies of the same data value, thefractional statistical rank of the tied data ends in ½.Percentile rank is another type of statistical ranking.
Microsoft Excel provides two ranking functions, theRank.EQ function which assigns competition ranks in the case of ties, and theRank.AVG function which assigns fractional ranks to ties. For example, if the data being ranked was ("5, 7, 7, 10"), thenRank.EQ would return ("1, 2, 2, 4"), whereasRank.AVG would return ("1, 2.5, 2.5, 4"). Note thatRank.AVG preserves rank sums in the case of ties, whereasRank.EQ does not. This makes the latter undesirable in many statistical applications. The functions have theorder argument,[1] which is by default is set todescending, i.e. the largest number will have a rank 1. This is generally uncommon for statistics where the ranking is usually in ascending order, where the smallest number has a rank 1.
Arank correlation can be used to compare two rankings for the same set of objects. For example,Spearman's rank correlation coefficient is useful to measure the statistical dependence between the rankings of athletes in two tournaments. And theKendall rank correlation coefficient is another approach. Alternatively, intersection/overlap-based approaches offer additional flexibility. One example is the "Rank–rank hypergeometric overlap" approach,[2] which is designed to compare ranking of the genes that are at the "top" of two ordered lists of differentially expressed genes. A similar approach is taken by the "Rank Biased Overlap (RBO)",[3] which also implements an adjustable probability, p, to customize the weight assigned at a desired depth of ranking. These approaches have the advantages of addressingdisjoint sets, sets of different sizes, and top-weightedness (taking into account the absolute ranking position, which may be ignored in standard non-weighted rank correlation approaches).
Let be a set of random variables. By sorting them into order, we have defined theirorder statistics[4]
If all the values are unique, the rank of variable number is the unique solution to the equation.In the presence of ties, we may either use a midrank (corresponding to the "fractional rank" mentioned above), defined as the average of all indices such that, or the uprank (corresponding to the"modified competition ranking") defined by.