# 斯皮尔曼等级相关系数

## 定义和计算

$\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 $\frac{4+3}{2}=3.5\$
1.2 3 $\frac{4+3}{2}=3.5\$
2.3 2 2
18 1 1

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

## 示例

 智商, $X_i$ 每周花在电视上的小时数, $Y_i$ 106 7 86 0 100 27 101 50 99 28 103 29 97 20 113 12 112 6 110 17

1. 排列第一列数据 ($X_i$)。 创建新列 $x_i$ 并赋以等级值 1,2,3,...n
2. 然后，排列第二列数据 ($Y_i$). 创建第四列 $y_i$ 并相似地赋以等级值 1,2,3,...n
3. 创建第五列 $d_i$ 保存两个等级列的差值 ($x_i$$y_i$).
4. 创建最后一列 $d^2_i$ 保存 $d_i$ 的平方.
 智商, $X_i$ 每周花在电视上的小时数, $Y_i$ 等级 $x_i$ 等级 $y_i$ $d_i$ $d^2_i$ 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

$\rho = 1- {\frac {6\times194}{10(10^2 - 1)}}$

ρ = −0.175757575...

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


## 显著性的确定

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

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

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

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

## 引文

1. ^ 1.0 1.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