Calculate Spearman's Rank Correlation Coefficient
Posted
by
Arvigeus
on Stack Overflow
See other posts from Stack Overflow
or by Arvigeus
Published on 2014-06-06T15:13:56Z
Indexed on
2014/06/06
15:24 UTC
Read the original article
Hit count: 196
I'm trying to calculate correlations using this method.
However, when I do the math by hand, I get one result, and when I do it with R - cor(dt, use="complete.obs", method="spearman")
- I get totally different thing.
Example data below:
---------------------------------
AnswerPosID.1007 AnswerPosID.1008
---------------------------------
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 2
1 2
1 1
1 1
1 1
1 1
2 1
2 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
---------------------------------
Manual result: 0.799777530589544;
R cor: -0.07142857
© Stack Overflow or respective owner