Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pearson correlation coefficient 2-tailed p-value meaning [closed]

from the sciPy library I used: scipy.stats.stats import pearsonr to calculate the correlation coefficient for two arrays and I got a value of: (0.80751532276005755, 0.19248467723994242).

I thought that I would have just got one value within the range -1 to +1, so I'm unsure how to interpret these two results. These are my two arrays:

x = [50,500,1500,2500]
y = [17, 6, 6, 194]

and I did:

pearsonr(x,y)

Thanks

like image 410
user94628 Avatar asked Nov 30 '12 22:11

user94628


People also ask

How do you interpret the p-value in a Pearson correlation?

– If the p-value is low (generally less than 0.05), then your correlation is statistically significant, and you can use the calculated Pearson coefficient.

What does SIG 2 tailed mean in Pearson correlation?

Sig (2-tailed)– This is the two-tailed p-value evaluating the null against an alternative that the mean is not equal to 50. It is equal to the probability of observing a greater absolute value of t under the null hypothesis.

What does it mean when a correlation coefficient is close to?

The correlation coefficient (expressed as r ) shows the direction and strength of a relationship between two variables. The closer the r value is to +1 or -1, the stronger the linear relationship between the two variables is.

What does correlation is significant at the 0.05 level 2 tailed mean?

Correlation is significant at the 0.05 level (2-tailed). (This means the value will be considered significant if is between 0.010 to 0,050).


1 Answers

pearsonr() returns a two-tuple consisting of the correlation coefficient and the corresponding p-value:

  • The correlation coefficient can range from -1 to +1.
  • The null hypothesis is that the two variables are uncorrelated. The p-value is a number between zero and one that represents the probability that your data would have arisen if the null hypothesis were true.

For a further discussion, see http://www.eecs.qmul.ac.uk/~norman/blog_articles/p_values.pdf

I thought that I would have just got one value within the range -1 to +1

If you just need to the correlation coefficient, simply ignore the second element of the tuple (the p-value):

corrxy = pearsonr(x,y)[0]

It might be worth mentioning that there's also numpy.corrcoef(), which computes the correlation matrix (without p-values).

like image 158
NPE Avatar answered Oct 11 '22 13:10

NPE