简体   繁体   English

paired.r功能-正确的自由度?

[英]paired.r Function - Correct degrees of freedom?

I have a dataset in which I am testing for a significant difference between two dependent correlations. 我有一个数据集,我正在其中测试两个相关性之间的显着差异。 For example, I examined the correlations between variables X and Z (corXZ) and between variables Y and Z (corYZ), and also want to know if corXZ and corYZ are significantly different, taking into account the correlation between X and Y (corXY). 例如,我检查了变量X和Z之间的相关性(corXZ)以及变量Y和Z之间的相关性(corYZ),并且还想知道corXZ和corYZ是否存在显着差异,同时考虑了X和Y之间的相关性(corXY) 。

I have been using the R function paired.r, which generally works very well. 我一直在使用R函数paired.r,通常效果很好。 But, as you can see, it does not provide the degrees of freedom in the output, simply a t-value: 但是,正如您所看到的,它不提供输出的自由度,只是一个t值:

https://www.rdocumentation.org/packages/psych/versions/1.7.8/topics/paired.r https://www.rdocumentation.org/packages/psych/versions/1.7.8/topics/paired.r

For the purposes of reporting such tests in a manuscript, I need to provide the accurate degrees of freedom. 为了在手稿中报告此类测试,我需要提供准确的自由度。 How do I find this or calculate this? 我如何找到这个或计算这个?

For the test with a third (yz) correlation specified, the degrees of freedom are = n-3 : 对于指定了第三(yz)相关性的测试,自由度为= n-3:

> # install.packages("psych")
> library(psych)
> 
> n = 100
> paired.r(.5,.3, .4, n = n)
Call: paired.r(xy = 0.5, xz = 0.3, yz = 0.4, n = n)
[1] "test of difference between two correlated  correlations"
t = 2.06  With probability =  0.04

> 2 * pt(q = 2.06, df = n-3, lower.tail = F) # 2 tailed p value
[1] 0.04207664


> n = 10
> paired.r(.5,.3, .4, n = n)
Call: paired.r(xy = 0.5, xz = 0.3, yz = 0.4, n = n)
[1] "test of difference between two correlated  correlations"
t = 0.56  With probability =  0.6

> 2 * pt(q = 0.56, df = n-3, lower.tail = F)
[1] 0.5929396
> 

The nice point with open source software like R is that you can always inspect the source code to answer this kind of question. 使用R这样的开源软件的R是,您始终可以检查源代码来回答此类问题。 Here you can simply type paired.r in the console (without parentheses) in the console to obtain the source code... 在这里,您只需在控制台的控制台中键入paired.r (不带括号)即可获取源代码...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM