What is a rank? I've been thinking about unifying some notions related to ranking, order theory, ordinal data, and graded posets. While the notion of a grade in order theory is quite general, in some sense the way we talk about ranks is more general. I would like to bring rank-based statistics and order theory together in my theory development and analysis of data.
I would really like to know if there are others (especially but not exclusively in the literature) that have attempted to define ranks in a way that generalizes or interoperates with concepts in order theory.
 A: The question seems to seek a high-brow formal and abstract definition of ranks.
This answer is for anyone -- especially those attracted by the thread title, not so much the detailed question -- interested in a low-brow informal treatment.
Just to remind you of basics if that would be helpful: Suppose you have some values, say 42, 1, 2, 2.71828, 3.14159. We can sort (order) those values to 1, 2, 2.71828, 3.14159, 42. So how might we rank them as well? Five values all different might be ranked 1 to 5, but how?
In ranking, there are at first sight at least three practical questions that arise:
1. Is the largest value to be assigned 1 or the smallest value to be assigned 1?
The general statistical convention seems to be to assign the smallest value to rank 1. This is tied up with conventions to do with order statistics.
In 1999  in a paper on pp.5-7 of Stata Technical Bulletin 51 field and track were suggested as terms for two kinds of ranks, Field ranks are those for which high values get low ranks (jumping or throwing the greatest height or distance wins). Track ranks are those for which low values get low ranks (in running, hurdling, walking, etc. the shortest time wins). This terminology is now used in Stata.
Negation of a variable or argument should be enough to flip between field and track ranks.
Hence suppose that 2, 3, 5, 7, 11 are to be ranked 11 first. Ranking -11, -7, -5, -3, -2 is how to do it if your software does not provide a switch.
2. What should be done about ties?
Now suppose that ties may exist, so that two or more observations may have the same value. This is very common in real data, especially if variables are counted or categorical.
A common convention given ties is to assign the mean of the ranks that would have been given otherwise, so that the sum of the ranks is preserved.
Thus values 1, 2, 2, 3, 3, 3 would be ranked 1, 2.5, 2.5, 5, 5, 5. The two values of 2 would have been ranked 2 and 3 (or 3 and 2!) had their values been slightly different. The three values of 3 would have been ranked 4, 5, 6 in some order had their values all been slightly different. 2.5 + 2.5 = 2 + 3 and 5 + 5 + 5 = 4 + 5 + 6, so the sum of ranks is what it would have been otherwise. This may seem small print, but the calculations behind nonparametric tests and associated procedures typically use the sum of ranks directly or indirectly.
Substantively, such tied ranks are often reported as
1, 2nd equal, 2nd equal, 4th equal, 4th equal, 4th equal
as used to be quite common in sports (less often now with say precise timers, photofinishes, detailed rules for breaking ties) and in education (the expression schoolmaster's rank is one I've seen in literature but do not recommend).
3. How to plot ordered or ranked data?
The standard definition of order statistics as defined say for a sample of size  $n$ of a variable $x$, namely $x_1, \dots, x_n$, by the inequalities
$$x_{(1)} \le x_{(2)} \le \dots \le x_{(n-1)} \le x_{(n)} $$
carries with it a recognition that tied values may arbitrarily but usefully be assigned different ranks, or at least tags, $1$ to $n$, so that each of those ranks or tags occurs exactly once. This convention can be helpful for plotting values against their rank, or vice versa, in a quantile plot or rank-size plot (many other names can be found). Otherwise tied values all assigned the same rank would necessarily be plotted with the same coordinates, which makes recognition of ties more difficult.
This convention is linked in turn to various slightly different ways of defining plotting positions or percentile ranks. a topic introduced for example (with some references and historical details) in  this FAQ.
A: I've included my attempt at defining a rank in order to illustrate some of the properties I'm interested in, but this should not be taken as a definitive answer. This definition reflects my cobbled together thinking from examples I have seen of "ranks".

Assume a collection random variables $\{X_1(\omega), \ldots, X_n(\omega) \}$ on outcome space $\Omega$, and partial order $\leq$. An  abstract ranking $\rho: \prod_{i=1}^n X_i(\omega) \mapsto \mathbb{R}_{\geq 0}^n$ is a function such that there exists a non-decreasing function $\kappa:\mathbb{N} \mapsto \mathbb{R}_{\geq0}$ that satisfies $\rho(\vec x)_i \leq \kappa(n)$ for all $i\in \{1, \ldots, n\}$. It must also hold that $\rho(\vec x)_i \leq \rho(\vec x)_j \iff x_i \leq x_j$ for all $i,j \in \{1, \ldots, n\}$ and for all $\omega \in \Omega$ exor $\rho(\vec x)_i \geq \rho(\vec x)_j \iff x_i \leq x_j$ for all $i,j \in \{1, \ldots, n\}$ and for all $\omega \in \Omega$. An component of an image element of an abstract ranking is called an abstract rank.

Here are some rationalizations for why I tried to define ranks this way.

*

*Why is $\rho$ non-negative? I think for three reasons:

*

*It is (for me) a little easier to keep track of positive numbers.

*Empirical induction: all the examples I've seen of "ranks" or "grade" meet this criterion.

*Allowing $\rho$ to have zero in its image can be a programing convenience where the rank can coincide with the indices of a data structure of sorted elements. Is adding one so difficult? No, but zero doesn't bother me either.

*Aesthetic: This feels right. ¯_(ツ)_/¯



*Why monotonic rather than nondecreasing in particular? While grades are order-preserving, sometimes we rank quantities in an order-reversing fashion. For example, in a contest of weight lifting the 1st place might go to the person who lifts the most weight.

*Why this bounding $\kappa$ function? A function being monotone and non-negative just didn't seem specific enough. I've noted as a matter of empirical induction that such a bound occurs with what have been usually described as ranks, and it is likewise true of grades, so I am content to include it.


I'm still ruminating about this potentially additional property:

It is also required of $\kappa$ that for any finite $n$ there exists $\omega$ in outcome space $\Omega$ such that $\max_i \rho (\vec x_{\omega})_i = \kappa(n)$.

A: How about:
A ranking is an order preserving or order reversing (surjective) mapping of a set of numbers to an interval of natural numbers starting from 0 or 1.
A rank is an element from the image of a ranking.

This definition has some limits when there are ties. In that case people sometimes define the rank as an average (not a natural number) or some places are skipped (not a surjective function).
For example we can have
$$\begin{array}{r}
\text{input} & \{1,&2,&3,&4,&4,&5\} \\\hline
\text{output1} & \{1,&2,&3,&4,&4,&5\} \\
\text{output2} & \{1,&2,&3,&5,&5,&6\} \\
\text{output3} & \{1,&2,&3,&4.5,&4.5,&5\} \\
\end{array}$$
Output 1 relates to the rank of a number $x$ defined as 'the number of unique values equal to or below $x$'.
Output 2 relates to the rank of a number $x$ defined as 'the number of numbers equal to or below $x$'.
Output 3 relates to the rank of a number $x$ defined as 'the number of numbers equal to or below $x$ if a value is unique, and when several numbers are the same/tied the average value of the ranks given to these numbers if they would not be tied'.
The definition as a ranking being 'surjective' and mapping to 'natural' numbers does not coincide with cases 2 and 3. But if we would adjust the definition to include cases 2 and 3, then the definition becomes very general and is just any order preserving mapping. The idea of a ranking as a counting process is lost.
A definition that can reconcile examples 1 and 2 is
The rank of the number $x_j$ in a list, is the number of numbers $x_i$ in that list, either counted with or without multiplicity, for which we have $x_i R x_j$, where $R$ is the binary relation $\leq$ or the binary relation $\geq$.
A: There are various definitions of ranks depending on context and the purpose for which they are defined.  However, a common definition relates them directly to order statistics.  Given a set of numbers $x_1,...,x_n$ with corresponding order statistics $x_{(1)} \leqslant \cdots \leqslant x_{(n)}$ the typical way to define the ranks $r_1,...,r_n$ for the variables is to require that they satisfy the defining requirement:
$$x_{(r_i)} = x_i
\quad \quad \quad \quad \quad 
\text{for all } i = 1,...,n.$$
This requirement is sufficient to define the ranks in the case where all the initial values are distinct.  In the case of ties there are various definitions of the ranks that will meet this requirement.
