Home > NaN > spearman.m

spearman

PURPOSE ^

SPEARMAN Spearman's rank correlation coefficient.

SYNOPSIS ^

function r = spearman(x,y)

DESCRIPTION ^

 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:02:45 by m2html © 2003