I had a strange correlation test result between two variables ($y$ = residuals of a linear regression, $x$ = dependent variable).
cor(y0,x0), which answer is
Oh, ok, I have almost zero correlation!
I decided to test that, and discovered
cor.test() function, for which follows:
cor.test(y0, x0, method = "s")
Spearman's rank correlation rho data: y0 and x0 S = 1076, p-value = 0.6623 alternative hypothesis: true rho is not equal to 0 sample estimates: rho -0.1104231
If p-value = 0.66 $\Rightarrow$ reject null hypothesis (true rho equal to 0) $\Rightarrow$ true rho isn't zero
And rho = -0.11. Cool! It seems that $y_0$ and $x_0$ are correlated in some way.
But I tried another example:
Again, in RStudio,
cor(y1,x1), which answer is
Spearman's rank correlation rho data: y1 and x1 S = 1100, p-value < 2.2e-16 alternative hypothesis: true rho is not equal to 0 sample estimates: rho -0.9642857
If p-value < 2.2e-16 ~ 0 $\Rightarrow$ accept null hypothesis (true rho equal to 0)
But rho = -0.96
How can I accept null hypothesis if rho ($\rho$) is nearly -1?
That does not make any sense to me.