相关性检验方法

2020-03-08  本文已影响0人  BeeBee生信

Pearson

假设

PS:检验数据分布方法见《fitdistrplus 检验数据的分布》一文
公式
r_{xy} = \cfrac{n\sum{x_{i}y_{i}} - \sum{x_{i}}\sum{y_{i}}}{\sqrt{n\sum{x_{i}^2} - (\sum{x_{i}})^2}\sqrt{n\sum{y_{i}^2} - (\sum{y_{i}})^2}}

度量效应
effect size 是对实验者效应大小的定量度量。度量效应常用 Cohen's d,用两组的均值差除以标准差。

Cohen's d 公式
d = \cfrac{\bar{x_{1}} - \bar{x_{2}}}{s_{pooled}}
其中
s_{pooled} = \sqrt{\cfrac{(n_{1} - 1)s_{1}^2 + (n_{2} - 1)s_{2}^2}{n_{1} + n_{2} - 2}}

Cohen's d 等级划分

效应大小 d
0.2
0.5
0.8

Cohen 总结了效应大小与相关系数的关系,得到了相关性(Strength of Association)与相关系数的关系。

相关性 |r|
0.1 - 0.3
中等 0.3 - 0.5
0.5 - 1

Kendall rank correlation

Kendall 法是非参数检验,不依赖于数据的分布。跟 Spearman 一样依赖于数据的秩,如果样本数少或者有许多同秩(tied ranks)可以用 kendall 法代替 Spearman。对于 n 个样本,两两组合共有 n(n - 1) / 2 种组合,Kendall rank correlation 公式
\tau = \cfrac{n_{c} - n_{d}}{\frac{1}{2}n(n - 1)}
其中

Spearman rank correlation

Spearman 也是无参的不对数据分布有要求/假设。但 Spearman 要求数据是有序的,像连续型变量比如金额、温度、高度这些都是有序的可以根据大小去排列;像小学-中学-高中-大学也是有序的;像风-马-牛这就是无序的。另外要求数据是单调(monotonic)关系的。下图解释了什么是单调关系。


单调关系

Spearman 公式
\rho = 1 - \cfrac{6\sum{d_{i}^2}}{n(n^2 - 1)}
其中
d_{i} = rg(x_{i}) - rg(y_{i})
是两变量排序等级的差异。

[参考]
Correlation (Pearson, Kendall, Spearman) - Statistics Solutions
What does effect size tell you? | Simply Psychology
Cohen’s Standards for Small, Medium, and Large Effect Sizes – Introductory Business Statistics
Kendall Rank Correlation Explained. - Towards Data Science

上一篇 下一篇

猜你喜欢

热点阅读