If you're seeing this message, it means we're having trouble loading external resources on our website. Show
If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked. There are many questions to ask when looking at a scatterplot. One of the most common is wondering how well a straight line approximates the data. To help answer this, there is a descriptive statistic called the correlation coefficient. We will see how to calculate this statistic. The Correlation CoefficientThe correlation coefficient, denoted by r, tells us how closely data in a scatterplot fall along a straight line. The closer that the absolute value of r is to one, the better that the data are described by a linear equation. If r =1 or r = -1 then the data set is perfectly aligned. Data sets with values of r close to zero show little to no straight-line relationship. Due to the lengthy calculations, it is best to calculate r with the use of a calculator or statistical software. However, it is always a worthwhile endeavor to know what your calculator is doing when it is calculating. What follows is a process for calculating the correlation coefficient mainly by hand, with a calculator used for the routine arithmetic steps. Steps for Calculating rWe will begin by listing the steps to the calculation of the correlation coefficient. The data we are working with are paired data, each pair of which will be denoted by (xi,yi).
This process is not hard, and each step is fairly routine, but the collection of all of these steps is quite involved. The calculation of the standard deviation is tedious enough on its own. But the calculation of the correlation coefficient involves not only two standard deviations, but a multitude of other operations. An ExampleTo see exactly how the value of r is obtained we look at an example. Again, it is important to note that for practical applications we would want to use our calculator or statistical software to calculate r for us. We begin with a listing of paired data: (1, 1), (2, 3), (4, 5), (5,7). The mean of the x values, the mean of 1, 2, 4, and 5 is x̄ = 3. We also have that ȳ = 4. The standard deviation of the x values is sx = 1.83 and sy = 2.58. The table below summarizes the other calculations needed for r. The sum of the products in the rightmost column is 2.969848. Since there are a total of four points and 4 – 1 = 3, we divide the sum of the products by 3. This gives us a correlation coefficient of r = 2.969848/3 = 0.989949. Table for Example of Calculation of Correlation Coefficientxyzxzyzxzy11-1.09544503-1.1618949581.27279205723-0.547722515-0.3872983190.212132009450.5477225150.3872983190.212132009571.095445031.1618949581.272792057 Cite this Article Format Your Citation Taylor, Courtney. "Calculating the Correlation Coefficient." ThoughtCo. https://www.thoughtco.com/how-to-calculate-the-correlation-coefficient-3126228 (accessed January 2, 2023). Pearson correlation coefficient, also known as Pearson R statistical test, measures the strength between the different variables and their relationships. Therefore, whenever any statistical test is conducted between the two variables, it is always a good idea for the person analyzing to calculate the value of the correlation coefficient to know how strong the relationship between the two variables is. Table of contentsPearson’s correlation coefficient returns a value between -1 and 1. The interpretation of the correlation coefficient is as under:
A higher absolute value of the correlation coefficient indicates a stronger relationship between variables. Thus, a correlation coefficient of 0.78 indicates a stronger positive correlationPositive CorrelationPositive Correlation occurs when two variables display mirror movements, fluctuating in the same direction, and are positively related. In layman's terms, if one variable increases by 10%, the other variable grows by 10% as well, and vice versa.read more than a value of 0.36. Similarly, a correlation coefficient of -0.87 indicates a stronger negative correlationNegative CorrelationA negative correlation is an effective relationship between two variables in which the values of the dependent and independent variables move in opposite directions. For example, when an independent variable increases, the dependent variable decreases, and vice versa.read more than a correlation coefficient of -0.40. You are free to use this image on your website, templates, etc., Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked In other words, if the value is in the positive range, the relationship between variables is positively correlated, and both values decrease or increase together. On the other hand, if the value is in the negative range, it shows that the relationship between variables is negatively correlated, and both values will go in the opposite direction. Pearson Correlation Coefficient FormulaPearson’s Correlation Coefficient formula is as follows, You are free to use this image on your website, templates, etc., Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked Where,
ExplanationThe steps to calculate Pearson correlation coefficient are as follows.
Example of Pearson Correlation Coefficient RYou can download this Pearson Correlation Coefficient Excel Template here – Example 1With the help of the following details in the table, the six people have different ages and weights given below for the calculation of the value of the Pearson R. Sr NoAge (x)Weight (y)140782217032560431555388064766Solution: For the Calculation of the Pearson Correlation Coefficient, we will first calculate the following values, Here the total number of people is 6 so, n=6 Now the calculation of the Pearson R is as follows,
Thus the value of the Pearson correlation coefficient is 0.35 Example #2There are 2 stocks – A and B. Their share prices on particular days are as follows: Stock A (x)Stock B (y)459508538587605Find out the Pearson correlation coefficient from the above data. Solution: First, we will calculate the following values. The calculation of the Pearson coefficient is as follows,
Therefore the Pearson correlation coefficient between the two stocks is -0.9088. Advantages
Disadvantages
Important Points
ConclusionThe Pearson correlation coefficient represents the relationship between the two variables, measured on the same interval or ratio scale. It measures the strength of the relationship between the two continuous variables. It not only states the presence or absence of the correlation between the two variables but also determines the exact extent to which those variables are correlated. It is independent of the unit of measurement of the variables where the values of the correlation coefficient can range from the value +1 to the value -1. However, it is insufficient to tell the difference between the dependent and independent variablesIndependent VariablesIndependent variable is an object or a time period or a input value, changes to which are used to assess the impact on an output value (i.e. the end objective) that is measured in mathematical or statistical or financial modeling.read more. Recommended ArticlesThis article is a guide to the Pearson Correlation Coefficient and its definition. Here, we discuss calculating the Pearson correlation coefficient R using its formula and example. You can learn more about Excel modeling from the following articles: – How to calculate a correlation coefficient?How Do You Calculate the Correlation Coefficient? The correlation coefficient is calculated by determining the covariance of the variables and dividing that number by the product of those variables' standard deviations.
What is the formula of simple correlation coefficient?The correlation coefficient formula is: r=n∑XY−∑X∑Y√(n∑X2−(∑X)2)⋅(n∑Y2−(∑Y)2) r = n ∑ X Y − ∑ X ∑ Y ( n ∑ X 2 − ( ∑ X ) 2 ) ⋅ ( n ∑ Y 2 − ( ∑ Y ) 2 ) .
How to calculate correlation coefficient from mean and standard deviation?Pearson's Correlation Coefficient r = covariance/(standard deviation x)(standard deviation y) or use r = Sxy/(S2x)(S2y).
|