What Pearson correlation coefficient is
The Pearson correlation coefficient (also known as the Pearson’s r or Pearson’s product-moment correlation coefficient) is a measure of the linear correlation between two variables. It is a numerical value between -1 and 1 that indicates the extent to which two variables are linearly related.
Steps for calculating the Pearson correlation coefficient:
-
Calculate the mean of each variable.
-
Calculate the difference between each data point and the mean of its respective variable.
-
Square the differences from Step 2.
-
Multiply the squares from Step 3 for each pair of data points.
-
Sum all the products from Step 4.
-
Calculate the standard deviation for each variable.
-
Multiply the standard deviations from Step 6.
-
Divide the sum from Step 5 by the product of the standard deviations from Step 7. This is the Pearson correlation coefficient.
Examples
-
Pearson correlation coefficient can be used to measure the strength of linear relationships between two continuous variables. For example, one could measure the relationship between the height and weight of individuals.
-
Pearson correlation coefficient can be used to compare the strength of the relationship between two variables in a bivariate dataset. For example, a researcher may wish to compare the strength of the relationship between gender and academic performance.
-
Pearson correlation coefficient can be used to measure the strength of the linear relationship between stock prices and the returns of two companies. For example, the correlation between the stock price of Apple and the return of Microsoft could be measured.