Skip to content
Advertisement

why p-value for high-correlation data is 1? what is wrong?

I try to filter correlation matrix with p-value for the following matrix

JavaScript

I use the following code

JavaScript

But the answer that I get it is strange, because the main correlation without filtering is

JavaScript

and the P-value matrix is

JavaScript

while all should be zero, I do not know what could be the reason, has someone had the same problem before?

Advertisement

Answer

To elaborate on what @Marat’s comment, you likely want:

JavaScript

Why is -1/1 what you’d expect here? Think about the case where x and y are just two values apiece, think about fitting a best fit line through a graph of these values. Something like:

JavaScript

enter image description here

So not too shabby!

You’re probably expecting someting like this:

JavaScript

enter image description here

As expected, not much of a correlation.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement