Rankings and Rank Correlations
This package implements various strategies for computing ranks and rank correlations.
StatsBase.ordinalrank — Function.ordinalrank(x)Return the ordinal ranking ("1234" ranking) of a real-valued array. All items in x are given distinct, successive ranks based on their position in sort(x).
StatsBase.competerank — Function.competerank(x)Return the standard competition ranking ("1224" ranking) of a real-valued array. Items that compare equal are given the same rank, then a gap is left in the rankings the size of the number of tied items - 1.
StatsBase.denserank — Function.denserank(x)Return the dense ranking ("1223" ranking) of a real-valued array. Items that compare equal receive the same ranking, and the next subsequent rank is assigned with no gap.
StatsBase.tiedrank — Function.tiedrank(x)Return the tied ranking, also called fractional or "1 2.5 2.5 4" ranking, of a real-valued array. Items that compare equal receive the mean of the rankings they would have been assigned under ordinal ranking.
StatsBase.corspearman — Function.corspearman(x, y=x)Compute Spearman's rank correlation coefficient. If x and y are vectors, the output is a float, otherwise it's a matrix corresponding to the pairwise correlations of the columns of x and y.
StatsBase.corkendall — Function.corkendall(x, y=x)Compute Kendall's rank correlation coefficient, τ. x and y must both be either matrices or vectors.