5

This is probably obvious for a statistician but I could not find to what refers the asymptotic t approximation method in the correlation test of R cor.test ?

?cor.test

For Spearman's test, p-values are computed using algorithm AS 89 for n < 1290 and exact = TRUE, otherwise via the asymptotic t approximation.

Stephan Kolassa
  • 95,027
  • 13
  • 197
  • 357
user3507085
  • 175
  • 4

2 Answers2

3

For the $n>1290$ case* (or when not using exact=TRUE), the test statistic used$^\dagger$ is this one:

$$t=r{\sqrt {{\frac {n-2}{1-r^{2}}}}}$$

which should be asymptotically distributed as $t_{n-2}$. [The same statistic is used when testing whether a Pearson correlation differs from 0, but the justification is different]

This statistic is discussed in the Wikipedia page for the Spearman coefficient.

It says there that

A justification for this result relies on a permutation argument.

and the citation for this claim is Vol 2. of Kendall and Stuart (§ 31.19, 31.21)


* The help is slightly inaccurate; it should say $n\leq 1290$ rather than $n<1290$ for the situation when it uses AS 89.

$\dagger$ You can see for yourself that it's doing this right in the code for the Spearman part of cor.test.default:

 pt(r/sqrt((1 - r^2)/(n - 2)), df = n - 2, 

That's the handy thing about actually being able to see the code -- you can check for yourself exactly what it's doing

Glen_b
  • 257,508
  • 32
  • 553
  • 939
2

Many test statistics's distributions under the null hypothesis will approach a certain known distribution as the sample size grows to infinity. In the present case, Spearman's rank correlation approaches a $t$ distribution as $n\to\infty$.

Often one will calculate $p$ values exactly or run simulations (e.g., ?chisq.test) for small sample sizes and rely on the asymptotic distribution for large sample sizes. See also Large sample asymptotic/theory - Why to care about?

You may be interested in browsing the tag.

Stephan Kolassa
  • 95,027
  • 13
  • 197
  • 357