SPEARMAN Spearman's rank correlation coefficient. This function is replaced by CORRCOEF. Significance test and confidence intervals can be obtained from CORRCOEF. [R,p,ci1,ci2] = CORRCOEF(x, [y, ] 'Rank'); For some (unknown) reason, in previous versions Spearman's rank correlation r = corrcoef(ranks(x)). But according to [1], Spearman's correlation is defined as r = 1-6*sum((ranks(x)-ranks(y)).^2)/(N*(N*N-1)) The results are different. Here, the later version is implemented. see also: CORRCOEF, RANKCORR REFERENCES: [1] http://mathworld.wolfram.com/SpearmanRankCorrelationCoefficient.html [2] http://mathworld.wolfram.com/CorrelationCoefficient.html
Package: nan