.
> cor.test(c(1,2,3,4,5), c(1,2,4,3,5), alternative = "greater", method = "pearson")
Pearson's product-moment correlation
data: c(1, 2, 3, 4, 5) and c(1, 2, 4, 3, 5)
t = 3.5762, df = 3, p-value = 0.01869
alternative hypothesis: true correlation is greater than 0
95 percent confidence interval:
0.2996475 1.0000000
sample estimates:
cor
0.9
> cor.test(c(1,2,3,4,5), c(1,2,4,3,5), alternative = "two.sided", method = "pearson")
Pearson's product-moment correlation
data: c(1, 2, 3, 4, 5) and c(1, 2, 4, 3, 5)
t = 3.5762, df = 3, p-value = 0.03739
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.08610194 0.99343752
sample estimates:
cor
0.9
As one can see, the alternative hypothesis used in the computation in STITCHIT is one-sided ("greater").
To also account for significant negative correlations, STITCHIT uses the absolute correlation for the Fisher's transformation:
Does this violate the alternative hypothesis, which should be two-sided (corr != 0)?
Dear STITCHIT-Team,
In the Test for p-values
using the vectors
STITCHIT/test/corCompTest.cpp
Line 15 in 641dc07
and
STITCHIT/test/corCompTest.cpp
Line 20 in 641dc07
the p-value is assumed to be 0.01866973
STITCHIT/test/corCompTest.cpp
Lines 310 to 314 in 641dc07
The corresponding R code:
As one can see, the alternative hypothesis used in the computation in STITCHIT is one-sided ("greater").
STITCHIT/core/CorComp.cpp
Line 170 in 641dc07
To also account for significant negative correlations, STITCHIT uses the absolute correlation for the Fisher's transformation:
STITCHIT/core/CorComp.cpp
Lines 141 to 149 in 641dc07
Does this violate the alternative hypothesis, which should be two-sided (corr != 0)?
Best,
Quirin