1
$\begingroup$

Does 'corr' function in Matlab consider correction for tied ranks while calculating Spearman correlation coefficient? Thanks.

$\endgroup$
1
  • 2
    $\begingroup$ The easy way to find out is to feed it some simple datasets having ties! $\endgroup$
    – whuber
    Commented Oct 22, 2010 at 21:12

1 Answer 1

3
$\begingroup$

looking in the corr function, I see that it calls tiedrank:

$ grep -B 1 tiedrank corr.m
      case 'k' % Kendall's tau
          [xrank, xadj] = tiedrank(xi,1);
          [yrank, yadj] = tiedrank(yj,1);
--
       case 's' % Spearman's rank correlation
          [xrank, xadj] = tiedrank(xi,0);
          [yrank, yadj] = tiedrank(yj,0);

Issuing a help tiedrank in Matlab should help you further along.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.