[英]paired.r Function - Correct degrees of freedom?
我有一個數據集,我正在其中測試兩個相關性之間的顯着差異。 例如,我檢查了變量X和Z之間的相關性(corXZ)以及變量Y和Z之間的相關性(corYZ),並且還想知道corXZ和corYZ是否存在顯着差異,同時考慮了X和Y之間的相關性(corXY) 。
我一直在使用R函數paired.r,通常效果很好。 但是,正如您所看到的,它不提供輸出的自由度,只是一個t值:
https://www.rdocumentation.org/packages/psych/versions/1.7.8/topics/paired.r
為了在手稿中報告此類測試,我需要提供准確的自由度。 我如何找到這個或計算這個?
對於指定了第三(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
>
使用R
這樣的開源軟件的R
是,您始終可以檢查源代碼來回答此類問題。 在這里,您只需在控制台的控制台中鍵入paired.r
(不帶括號)即可獲取源代碼...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.