Measures of association or relationship: correlation

00Comment iconComment iconComment iconComment icon

We continue studying the relationship between two variables, now looking at the correlation

Writer image

Translated byEditorial

Writer image

Revised byEditorial

Edit Article

Introduction

Similar to covariance: when two variables are linked by a statistical relationship, we say there is a correlation between them.

Functional relationship

As we know, the perimeter and the side of a square are related. The relationship that connects them is perfectly defined and can be expressed by means of a mathematical statement:

\[ 2p = 4l \]

Where 2p is the perimeter and l is the side.

Then, by assigning any value to R, it is possible to determine exactly the value of 2p.

Now let us consider the relationship that exists between the weight and height of a group of people. It is clear that this relationship is not of the same type as the previous one; it is much less precise. Thus, it may happen that different heights correspond to equal weights, or that equal heights correspond to different weights. However, on average, the greater the height, the greater the weight.

Relationships of the perimeter-side type are known as functional relationships, and those of the weight-height type as statistical relationships.

Scatter diagram

Let us consider a random sample consisting of ten of the 98 students in a class at college A and the grades they obtained in Mathematics and Statistics:

Mathematics gradeStatistics grade
5.06.0
8.09.0
7.08.0
10.010.0
6.05.0
7.07.0
9.08.0
3.04.0
8.06.0
2.02.0

By representing, in an orthogonal Cartesian coordinate system, the ordered pairs (xi, y), we obtain a cloud of points that we call a scatter diagram. This diagram gives us a rough but useful idea of the existing correlation, which in this case exists and is positive.

Image content of the Website

What Linear Correlation Is

Since the correlation under study has an ascending straight line as its "image," it is called positive linear correlation.

Thus, a correlation is:

- positive linear if the points in the diagram have an ascending straight line as their "image";

- negative linear if the points have a descending straight line as their "image";

- nonlinear if the points have a curve as their "image."

If the points are scattered and do not offer a defined "image," we conclude that there is no relationship at all between the variables under study.

We then have:

Image content of the Website

How to calculate the linear correlation coefficient

The tool used to measure linear correlation is the correlation coefficient. This coefficient should indicate the degree of intensity of the correlation between two variables and also the direction of this correlation (positive or negative).

We will use Pearson's correlation coefficient, which is given by:

\[ r = \dfrac{\sigma_{x,y}}{\sigma_x · \sigma_y} \]

> The correlation coefficient is the covariance divided by the standard deviation of each variable studied

Another formula would be:

\[ r = \frac{\sum{(x - \bar{x})(y - \bar{y})}}{\sqrt{\sum{(x - \bar{x})^{2}}} · \sqrt{\sum{(y - \bar{y})^{2}}}} \]

Unlike covariance, where we could only analyze whether it is positive or negative, the correlation coefficient gives us much more information because it is between -1 and 1; in other words, it belongs to the interval [-1, +1].

Thus:

a. if the correlation between two variables is perfect and positive, then r = +1;

b. if the correlation is perfect and negative, then r = -1;

c. if there is no correlation between the variables, then r = 0.

For:

value of r (+ or -)interpretation
0 to 19%Very weak correlation
20% to 39%Weak correlation
40% to 59%Moderate correlation
60% to 79%Strong correlation
80% to 100%Very strong correlation

Properties of correlation

1. The correlation coefficient is independent of the units of measurement of the variables; it is a dimensionless number that varies between –1 and +1, that is, -1 ≤ r ≤ + 1.

2. The correlation coefficient of a variable with itself is equal to +1.

3. Permuting the variables does not change the result of the correlation coefficient, that is, rXY = rYX.

4. Adding or subtracting a constant to one or both variables does not change the correlation coefficient.

5. Multiplying or dividing one or both variables by a constant does not change the correlation coefficient.

Examples

Complete the calculation scheme for the correlation coefficient for the values of variables x and y:

xy
124
106
88
1210
1412

The covariance of the data set is 2.4. Meanwhile, the standard deviation of the first variable is 2.04 and that of the second is 2.83.

Therefore:

\[ r = \frac{2.4}{2.04·2.83} = 0.41 = 41\% = \text{moderate correlation} \]

Exercises

1) Draw the different scatter diagrams that can be found for the following correlations: perfect positive correlation, negative correlation, and nonlinear correlation.

2) Make the scatter diagram for the following variables:

xy
5010
6020
80100
5025

What type of correlation do these variables present?

3) What is the correlation coefficient of the variables from the previous exercise?

4) What is the correlation coefficient of the following variables:

xy
1020
305
1515
550

5) What is the correlation coefficient of the following variables:

xy
101
302
1540
53

6) Davi found that the covariance of two data sets was equal to 10, and the standard deviation of one set has a value of 2 and the other has a value of 5. What is the correlation coefficient of the two data sets?

7) Once again, Davi found that the covariance of two data sets was equal to 200, and the standard deviation of one set has a value of 20 and the other has a value of 40. But after already making this analysis, he had to modify one of the data sets by dividing it by 10,000. What is the correlation coefficient of the two data sets now?

Answer Key

2) Positive linear correlation

3) 94%

4) -83%

5) 0%

6) 100%

7) 25%