Rankings and Rank Correlations

Rankings and Rank Correlations

This package implements various strategies for computing ranks and rank correlations.

StatsBase.ordinalrankFunction.
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).

source
StatsBase.competerankFunction.
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.

source
StatsBase.denserankFunction.
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.

source
StatsBase.tiedrankFunction.
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.

source
StatsBase.corspearmanFunction.
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.

source
StatsBase.corkendallFunction.
corkendall(x, y=x)

Compute Kendall's rank correlation coefficient, τ. x and y must both be either matrices or vectors.

source