SpearmanRho
Spearman's rho, denoted ρs or rs, is a nonparametric measure of rank correlation that assesses the strength and direction of a monotonic relationship between two variables. It is defined as the Pearson correlation coefficient between the ranked variables. Given paired observations (x_i, y_i), assign ranks R(x_i) and R(y_i) (ties are typically assigned the average of the ranks that would have been assigned). The coefficient can be computed as rs = cov(R_x, R_y) / (sd(R_x) sd(R_y)). An explicit formula for the case with no ties is rs = 1 - 6 ∑ d_i^2 / [n(n^2 - 1)], where d_i = R(x_i) - R(y_i). In the presence of ties, rs is computed via the correlation of the ranks, or a tie-adjusted formula.
Interpretation: rs values range from -1 to 1. Values near 1 indicate a strong positive monotonic association;
Computation and usage: Most statistics packages provide a function to compute Spearman's rho and an associated