# 斯皮尔曼等级相关系数

## 定义和计算

${\displaystyle \rho ={\frac {\sum _{i}(x_{i}-{\bar {x}})(y_{i}-{\bar {y}})}{\sqrt {\sum _{i}(x_{i}-{\bar {x}})^{2}\sum _{i}(y_{i}-{\bar {y}})^{2}}}}.}$

0.8 5 5
1.2 4 ${\displaystyle {\frac {4+3}{2}}=3.5\ }$
1.2 3 ${\displaystyle {\frac {4+3}{2}}=3.5\ }$
2.3 2 2
18 1 1

${\displaystyle \rho =1-{\frac {6\sum d_{i}^{2}}{n(n^{2}-1)}}.}$

## 示例

 智商, ${\displaystyle X_{i}}$ 每周花在电视上的小时数, ${\displaystyle Y_{i}}$ 106 7 86 0 100 27 101 50 99 28 103 29 97 20 113 12 112 6 110 17

1. 排列第一列数据 (${\displaystyle X_{i}}$ )。 创建新列 ${\displaystyle x_{i}}$  并赋以等级值 1,2,3,...n
2. 然后，排列第二列数据 (${\displaystyle Y_{i}}$ ). 创建第四列 ${\displaystyle y_{i}}$  并相似地赋以等级值 1,2,3,...n
3. 创建第五列 ${\displaystyle d_{i}}$  保存两个等级列的差值 (${\displaystyle x_{i}}$ ${\displaystyle y_{i}}$ ).
4. 创建最后一列 ${\displaystyle d_{i}^{2}}$  保存 ${\displaystyle d_{i}}$  的平方.
 智商, ${\displaystyle X_{i}}$ 每周花在电视上的小时数, ${\displaystyle Y_{i}}$ ${\displaystyle x_{i}}$ 的排名 ${\displaystyle y_{i}}$ 的排名 ${\displaystyle d_{i}}$ ${\displaystyle d_{i}^{2}}$ 86 0 1 1 0 0 97 20 2 6 −4 16 99 28 3 8 −5 25 100 27 4 7 −3 9 101 50 5 10 −5 25 103 29 6 9 −3 9 106 7 7 3 4 16 110 17 8 5 3 9 112 6 9 2 7 49 113 12 10 4 6 36

${\displaystyle \rho =1-{\frac {6\times 194}{10(10^{2}-1)}}}$

ρ = −0.175757575...

，P-value = 0.6864058 (使用 t分布)


## 显著性的确定

${\displaystyle F(r)={1 \over 2}\ln {1+r \over 1-r}=\operatorname {arctanh} (r).}$

${\displaystyle z={\sqrt {\frac {n-3}{1.06}}}F(r)}$

rz-值 ，其中，r统计依赖(ρ = 0).[5][6]零假设下 近似服从标准 正态分布

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

## 引文

1. Myers, Jerome L.; Well, Arnold D., Research Design and Statistical Analysis 2nd, Lawrence Erlbaum: 508, 2003, ISBN 0-8058-4037-0
2. ^ Maritz. J.S. (1981) Distribution-Free Statistical Methods, Chapman & Hall. ISBN 0-412-15940-6. (page 217)
3. ^ Yule, G.U and Kendall, M.G. (1950), "An Introduction to the Theory of Statistics", 14th Edition (5th Impression 1968). Charles Griffin & Co. page 268
4. ^ Piantadosi, J.; Howlett, P.; Boland, J. (2007) "Matching the grade correlation coefficient using a copula with maximum disorder", Journal of Industrial and Management Optimization, 3 (2), 305–312
5. ^ Choi, S.C. (1977) Test of equality of dependent correlations. Biometrika, 64 (3), pp. 645–647
6. ^ Fieller, E.C.; Hartley, H.O.; Pearson, E.S. (1957) Tests for rank correlation coefficients. I. Biometrika 44, pp. 470–481
7. ^ Press, Vettering, Teukolsky, and Flannery (1992) Numerical Recipes in C: The Art of Scientific Computing, 2nd Edition, page 640
8. ^ Kendall, M.G., Stuart, A. (1973)The Advanced Theory of Statistics, Volume 2: Inference and Relationship, Griffin. ISBN 0-85264-215-6 (Sections 31.19, 31.21)
9. ^ Page, E. B. Ordered hypotheses for multiple treatments: A significance test for linear ranks. Journal of the American Statistical Association. 1963, 58 (301): 216–230. doi:10.2307/2282965.
10. ^ Kowalczyk, T.; Pleszczyńska E. , Ruland F. (eds.). Grade Models and Methods for Data Analysis with Applications for the Analysis of Data Populations. Studies in Fuzziness and Soft Computing vol. 151. Berlin Heidelberg New York: Springer Verlag. 2004. ISBN 978-3-540-21120-4.
• G.W. Corder, D.I. Foreman, "Nonparametric Statistics for Non-Statisticians: A Step-by-Step Approach", Wiley (2009)
• C. Spearman, "The proof and measurement of association between two things" Amer. J. Psychol., 15 (1904) pp. 72–101
• M.G. Kendall, "Rank correlation methods", Griffin (1962)
• M. Hollander, D.A. Wolfe, "Nonparametric statistical methods", Wiley (1973)
• J. C. Caruso, N. Cliff, "Empirical Size, Coverage, and Power of Confidence Intervals for Spearman's Rho", Ed. and Psy. Meas., 57 (1997) pp. 637–654