美文网首页
相关系数 统计学比较

相关系数 统计学比较

作者: 上校的猫 | 来源:发表于2019-04-16 19:35 被阅读0次

写在前面

数据分析中遇到一些问题,将样本根据某些条件分成不同的组,不同组中样本的某两个变量之间相关性发生改变,这时就需要分析相关性的改变是因为分组导致的还是仅仅因为样本量的改变导致的。大家应该遇到过样本量越少,相关性越容易高得情况。所以需要一种统计方法来比较不同组的不同相关性之间有没有差异。当然还有其他需要比较相关性的需求。

参考

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0121945

情况分类

(1) The correlations were measured in two independent groups A and B. This case applies, for example, if a researcher wants to compare the correlations between anxiety and extraversion in two different groups A and B (ρA = ρB). If the two groups are dependent, the relationship between them needs further differentiation: (2) The two correlations can be overlapping (ρA12 = ρA23), i.e., the correlations have one variable in common. ρA12 and ρA23 refer to the population correlations in group A between variables 1 and 2 and variables 2 and 3, respectively. For instance, a researcher may be interested in determining whether the correlation between anxiety and extraversion is smaller than between anxiety and diligence within the same group A. (3) In the case of two dependent correlations, the two correlations can also be nonoverlapping (ρA12 = ρA34), i.e., they have no variable in common. This case applies, for example, if a researcher wants to determine whether the correlation between anxiety and extraversion is higher than the correlation between intelligence and creativity within the same group. A researcher also faces nonoverlapping dependent correlations when investigating whether the correlation between two variables is higher before rather than after a treatment provided to the same group.

  1. 样本互相独立。比如A组为成年人身高和体重的相关性 r1,B组为儿童身高与体重之间的相关性 r2 。比较r1 和 r2 。
  2. 样本依赖情况一。比如还是A组成年人,身高与体重的相关性 r1,身高与臂长的相关性 r2 。这里还有一个共有的身高变量重叠。
  3. 样本依赖情况二。比如还是A组成年人,身高和体重的相关性 r1,智力与年龄的相关性 r2 。变量非重叠。

直接在网页中分析

http://comparingcorrelations.org/

使用R包 cocor

安装

install.packages(“cocor”)
library(cocor)

分情况分析

  1. 样本非依赖的情况。使用数据 aptitude 示例,数据格式如下图,是个列表,包含两个数据框。


    image.png
require("cocor")
data("aptitude")
cocor(~logic + intelligence.a | logic + intelligence.a, aptitude)

下面是输出结果,r1.jk 和 r2.hm 没有显著差异,不能拒绝原假设。

#Results of a comparison of two correlations based on independent groups

#Comparison between r1.jk (logic, intelligence.a) = 0.3213 and #r2.hm (logic, intelligence.a) = 0.2024
#Difference: r1.jk - r2.hm = 0.1189
#Data: sample1: j = logic, k = intelligence.a; sample2: h = logic, m = #intelligence.a
#Group sizes: n1 = 291, n2 = 334
#Null hypothesis: r1.jk is equal to r2.hm
#Alternative hypothesis: r1.jk is not equal to r2.hm (two-sided)
#Alpha: 0.05

#fisher1925: Fisher's z (1925)
#  z = 1.5869, p-value = 0.1125
#  Null hypothesis retained

#zou2007: Zou's (2007) confidence interval
#  95% confidence interval for r1.jk - r2.hm: -0.0281 0.2637
#  Null hypothesis retained (Interval includes 0)

在没有原始数据的也可以使用下面方法

cocor.indep.groups(r1.jk = 0.3213, r2.hm = 0.2024, n1 = 291, n2 = 334)
  1. 第二种情况,样本依赖,相关性变量有重叠
cocor(~knowledge + intelligence.a | logic + intelligence.a, 
  aptitude[["sample1"]])

或者

cocor.dep.groups.overlap(r.jk = 0.1038, r.jh = 0.3213, r.kh = 0.0257, n = 291)
  1. 第三种情况,样本依赖,变量不重叠
cocor(~ knowledge + intelligence.a | logic + intelligence.b, aptitude[["sample1"]])

或者


cocor.dep.groups.nonoverlap(r.jk = 0.1038, r.hm = 0.2679, r.jh = 0.0257, 
                            r.jm = 0.1713, r.kh = 0.3213, r.km = 0.4731, n = 291)

相关文章

  • 【Excel系列】Excel数据分析:相关与回归分析

    相关系数 15.1 相关系数的概念 著名统计学家卡尔·皮尔逊设计了统计指标——相关系数(Correlation c...

  • 与相关性分析有关的两个概念(Pearson/Spearman)

    生物统计学中运用比较普遍的一个概念就是相关系数,可以通过相关系数这一基本概念,衍生到构建基因共表达网络。大部分基因...

  • 相关系数 统计学比较

    写在前面 数据分析中遇到一些问题,将样本根据某些条件分成不同的组,不同组中样本的某两个变量之间相关性发生改变,这时...

  • 相关性

    在 统计学中, 以查尔斯·斯皮尔曼命名的斯皮尔曼等级相关系数,即spearman相关系数。经常用希腊字母ρ表示。 ...

  • 相关性

    参考书 《白话统计学》 相关系数变量间关联的基本测度之一。 相关系数的两个基本特征: 方向 强度或量级 方向 相关...

  • 莫兰指数:背景篇

    统计学的相关系数与莫兰指数有什么联系吗?在Emmanuel Paradis的《Moran’s Autocorrel...

  • 时差相关分析

    1 概念 1.1 相关程度与相关函数的联系 在概率论和统计学中,相关(Correlation,或称相关系数或关联系...

  • R语言相关性的度量

    R可以计算多种相关系数,包括pearson相关系数、Spearman相关系数、Kendall相关系数、偏相关系数、...

  • 数学建模笔记——相关系数

    今天写一个比较简单也比较常用的内容——相关系数。 相关系数,并不是一个陌生的概念,因为高中的时候好像就学过了。只不...

  • python实现KMO检验和Bartlett's球形检验

    1.KMO KMO(Kaiser-Meyer-Olkin)检验统计量是用于比较变量间简单相关系数和偏相关系数的指标...

网友评论

      本文标题:相关系数 统计学比较

      本文链接:https://www.haomeiwen.com/subject/vvvbwqtx.html