I just need some clarification regarding the interpretation of the Spearman's Rank Correlation Coefficient output in R. I am currently determining correlations over a tri-nominal temporal scale in an ecological setting. My basic code is as below:
cor.test(v1,v2,method="spearman")
and the example output is as follows:
Spearman's rank correlation rho
data: v1 and v2
S = 466770, p-value = 0.4601
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.06203443
I understand the output for the rho and p values however i cannot find a definitive answer for what 'S' is? Am i required to report this value? Any clarification will be much welcomed.
Thanks
Best Answer
S
is the test statistic which is the sum of all squared rank differences. To make it more understandable. Assume we have to following data:Now, we get the ranks.
The sum over all
d^2
is 4 + 4 + 1 + 9 = 18. (Another example can be found here: https://statistics.laerd.com/statistical-guides/spearmans-rank-order-correlation-statistical-guide-2.php)We find the same thing in R:
S
is derived from random variables and can be assumed to have a distribution (like a t-distribution or normal-distribution). And depending on the distribution and their parameters you can say how likeli it is to observe this (or a more extreme) value under this distribution. This is your p-value.In moste cases I would say that the major part of the readers is happy with the correlation-coefficient, the p-value and the cases numbers ("n"). But this is a next question that would better fit at https://academia.stackexchange.com/.