<< nan_partcorrcoef Data Correlation and Covariance nan_tiedrank >>

NaN Toolbox >> NaN Toolbox > Data Correlation and Covariance > nan_rankcorr

nan_rankcorr

calculated the rank correlation coefficient.

Calling Sequence

r = nan_rankcorr(X,Y)

Description

This function is replaced by corrcoef. Significance test and confidence intervals can be obtained from corrcoef, too.

R = nan_corrcoef(X, [Y, ] 'Rank');

The rank correlation r = corrcoef(ranks(x)). is often confused with Spearman's rank correlation. Spearman's correlation is defined as

r(x,y) = 1-6*sum((ranks(x)-ranks(y)).^2)/(N*(N*N-1))

The results are different. Here, the former version is implemented.

See also

Bibliography

[1] http://mathworld.wolfram.com/SpearmanRankCorrelationCoefficient.html

[2] http://mathworld.wolfram.com/CorrelationCoefficient.html

Authors


<< nan_partcorrcoef Data Correlation and Covariance nan_tiedrank >>