r = \dfrac{n \sum xy – \sum x \sum y}{\sqrt{n \sum x^2 – (\sum x)^2} \sqrt{n \sum y^2 – (\sum y)^2}}

Where:

– n : Total number of data points in the dataset

– \sum x : Sum of all the x values in the dataset

– \sum y : Sum of all the y values in the dataset

– \sum x^2 : Sum of the squares of all the x values in the dataset

– \sum y^2 : Sum of the squares of all the y values in the dataset

– \sum xy : Sum of the product of the x and y values in the dataset

Correlation coefficient is a statistical measure that determines the strength and direction of a relationship between two variables. It ranges from -1 to +1, where:

-1 indicates a perfect negative correlation,

0 indicates no correlation, and

+1 indicates a perfect positive correlation.

Correlation coefficient is denoted by the symbol \rho (rho) for a population and by the symbol r for a sample.

An experiment conducted in the past to determine the correlation coefficient involved collecting data on the hours of study and exam scores of a group of students. The correlation coefficient was calculated to determine if there was a relationship between the two variables.

Practical work involving the calculation of correlation coefficient can help in identifying patterns and trends in data. It is often used in research studies, economics, psychology, and other fields to analyze the relationship between variables.

The formula to calculate the correlation coefficient r for a sample is:

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

where n is the number of data points, x and y are the variables, and \sum denotes summation.

Values range from -1 to +1, with -1 indicating a perfect negative correlation, 0 indicating no correlation, and +1 indicating a perfect positive correlation.

- Â If the correlation coefficient is close to +1, it indicates a strong positive correlation, meaning that as one variable increases, the other variable tends to also increase.
- If the correlation coefficient is close to -1, it indicates a strong negative correlation, meaning that as one variable increases, the other variable tends to decrease.
- If the correlation coefficient is close to 0, it indicates no correlation between the two variables, meaning that changes in one variable do not predict changes in the other variable.

There are several methods for calculating the correlation coefficient between two sets of data.

**1. Pearson Correlation Coefficient:** This is the most commonly used method for calculating the correlation coefficient. It measures the linear relationship between two variables. The formula for calculating the Pearson correlation coefficient is

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

where:

- r is the Pearson correlation coefficient

- n is the number of data points

- x and y are the two sets of data

- \sum denotes the sum of the values in a dataset

- xy is the product of the corresponding values in the two datasets

**2. Spearman Rank Correlation Coefficient**: This method is used when the data cannot be assumed to have a normal distribution or the relationship between variables is non-linear. It measures the strength and direction of the relationship between two variables based on their ranks. The formula for calculating the Spearman rank correlation coefficient is:

\rho = 1 - \frac{6\sum{d_i^2}}{n(n^2 - 1)}

where:

- \rho is the Spearman correlation coefficient

- d_i is the difference in ranks between the two datasets for each data point

- n is the number of data points

**3. Kendall Tau Correlation Coefficient**: This method is similar to the Spearman rank correlation coefficient and is used when data are ranked. It measures the strength and direction of the relationship between two variables, considering the concordant and discordant pairs of data points. The formula for calculating the Kendall tau correlation coefficient is:

Â Ï„ = (n(c) - n(d)) / (n(n-1) / 2)

Where:

Ï„ = Kendall tau correlation coefficient

n(c) = number of concordant pairs

n(d) = number of discordant pairs

n = sample size

These are some of the methods for calculating the correlation coefficient. The choice of method may depend on the nature of the data and the research question being addressed.

Â

Continue Reading Note on Correlation coefficient
It Sticks!

Correlation coefficient

Step by step solution:

Given data set:

X = \{1, 2, 3, 4, 5\}

Y = \{2, 4, 6, 8, 10\}

**Calculate the means of X and Y:**

\bar{X} = \frac{1 + 2 + 3 + 4 + 5}{5} = 3

\bar{Y} = \frac{2 + 4 + 6 + 8 + 10}{5} = 6

**Calculate the covariance:**

Cov(X, Y) = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{n-1}

= \frac{(1-3)(2-6) + (2-3)(4-6) + (3-3)(6-6) + (4-3)(8-6) + (5-3)(10-6)}{5-1}

= \frac{(-2)(-4) + (-1)(-2) + (0)(0) + (1)(2) + (2)(4)}{4}

= \frac{8 + 2 + 0 + 2 + 8}{4}

= \frac{20}{4} = 5

**Calculate the standard deviations of X and Y:**

S_X = \sqrt{\frac{\sum (X_i - \bar{X})^2}{n-1}}

= \sqrt{\frac{(1-3)^2 + (2-3)^2 + (3-3)^2 + (4-3)^2 + (5-3)^2}{5-1}}

= \sqrt{\frac{4 + 1 + 0 + 1 + 4}{4}}

= \sqrt{\frac{10}{4}} = \sqrt{2.5}

S_Y = \sqrt{\frac{\sum (Y_i - \bar{Y})^2}{n-1}}

= \sqrt{\frac{(2-6)^2 + (4-6)^2 + (6-6)^2 + (8-6)^2 + (10-6)^2}{5-1}}

= \sqrt{\frac{16 + 4 + 0 + 4 + 16}{4}}

= \sqrt{\frac{40}{4}} = \sqrt{10}

**Calculate the correlation coefficient:**

r = \frac{Cov(X, Y)}{S_X \cdot S_Y}

= \frac{5}{\sqrt{2.5} \cdot \sqrt{10}}

= \frac{5}{\sqrt{25}} = \frac{5}{5} = 1

Therefore, the correlation coefficient for the given data set is 1, indicating a perfect positive linear relationship.

Step by step solution:

Given data set:

X = \{3, 7, 4, 10, 8\}

Y = \{5, 9, 6, 15, 12\}

**Calculate the means of X and Y:**

\bar{X} = \frac{3 + 7 + 4 + 10 + 8}{5} = 6.4

\bar{Y} = \frac{5 + 9 + 6 + 15 + 12}{5} = 9.4

**Calculate the covariance:**

Cov(X, Y) = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{n-1}

= \frac{(3-6.4)(5-9.4) + (7-6.4)(9-9.4) + (4-6.4)(6-9.4) + (10-6.4)(15-9.4) + (8-6.4)(12-9.4)}{5-1}

= \frac{(-3.4)(-4.4) + (0.6)(-0.4) + (-2.4)(-3.4) + (3.6)(5.6) + (1.6)(2.6)}{4}

= \frac{14.92 - 0.24 + 8.16 + 20.16 + 4.16}{4}

= \frac{47.16}{4} = 11.79

**Calculate the standard deviations of X and Y:**

S_X = \sqrt{\frac{\sum (X_i - \bar{X})^2}{n-1}}

= \sqrt{\frac{(3-6.4)^2 + (7-6.4)^2 + (4-6.4)^2 + (10-6.4)^2 + (8-6.4)^2}{5-1}}

= \sqrt{\frac{12.96 + 0.36 + 7.84 + 12.96 + 3.24}{4}}

= \sqrt{\frac{37.36}{4}} = \sqrt{9.34}

S_Y = \sqrt{\frac{\sum (Y_i - \bar{Y})^2}{n-1}}

= \sqrt{\frac{(5-9.4)^2 + (9-9.4)^2 + (6-9.4)^2 + (15-9.4)^2 + (12-9.4)^2}{5-1}}

= \sqrt{\frac{5.76 + 0.16 + 12.96 + 27.04 + 5.76}{4}}

= \sqrt{\frac{51.68}{4}} = \sqrt{12.92}

**Calculate the correlation coefficient:**

r = \frac{Cov(X, Y)}{S_X \cdot S_Y}

= \frac{11.79}{\sqrt{9.34} \cdot \sqrt{12.92}}

= \frac{11.79}{\sqrt{113.75}} = \frac{11.79}{10.67} = 1.11

Therefore, the correlation coefficient for the given data set is approximately 1.11, indicating a strong positive linear relationship.

Step by step solution:

Given data set:

X = \{2, 5, 7, 9, 11\}

Y = \{4, 12, 16, 20, 24\}

**Calculate the means of X and Y:**

\bar{X} = \frac{2 + 5 + 7 + 9 + 11}{5} = 6.8

\bar{Y} = \frac{4 + 12 + 16 + 20 + 24}{5} = 15.2

**Calculate the covariance:**

Cov(X, Y) = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{n-1}

= \frac{(2-6.8)(4-15.2) + (5-6.8)(12-15.2) + (7-6.8)(16-15.2) + (9-6.8)(20-15.2) + (11-6.8)(24-15.2)}{5-1}

= \frac{(-4.8)(-11.2) + (-1.8)(-3.2) + (0.2)(0.8) + (2.2)(4.8) + (4.2)(8.8)}{4}

= \frac{53.76 + 5.76 + 0.16 + 10.56 + 36.96}{4}

= \frac{107.2}{4} = 26.8

**Calculate the standard deviations of X and Y:**

S_X = \sqrt{\frac{\sum (X_i - \bar{X})^2}{n-1}}

= \sqrt{\frac{(2-6.8)^2 + (5-6.8)^2 + (7-6.8)^2 + (9-6.8)^2 + (11-6.8)^2}{5-1}}

= \sqrt{\frac{20.25 + 3.24 + 0.04 + 5.29 + 20.25}{4}}

= \sqrt{\frac{48.07}{4}} = \sqrt{12.02}

S_Y = \sqrt{\frac{\sum (Y_i - \bar{Y})^2}{n-1}}

= \sqrt{\frac{(4-15.2)^2 + (12-15.2)^2 + (16-15.2)^2 + (20-15.2)^2 + (24-15.2)^2}{5-1}}

= \sqrt{\frac{121.6 + 10.24 + 0.64 + 20.16 + 72.16}{4}}

= \sqrt{\frac{224.8}{4}} = \sqrt{56.2}

**Calculate the correlation coefficient:**

r = \frac{Cov(X, Y)}{S_X \cdot S_Y}

= \frac{26.8}{\sqrt{12.02} \cdot \sqrt{56.2}}

= \frac{26.8}{\sqrt{675.65}} = \frac{26.8}{25.99} = 1.03

Therefore, the correlation coefficient for the given data set is approximately 1.03, indicating a strong positive linear relationship.

Step by step solution:

Given data set:

X = \{1, 2, 3, 4, 5\}

Y = \{-3, -6, -9, -12, -15\}

**Calculate the means of X and Y:**

\bar{X} = \frac{1 + 2 + 3 + 4 + 5}{5} = 3

\bar{Y} = \frac{-3 + (-6) + (-9) + (-12) + (-15)}{5} = -9

**Calculate the covariance:**

Cov(X, Y) = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{n-1}

= \frac{(1-3)(-3+9) + (2-3)(-6+9) + (3-3)(-9+9) + (4-3)(-12+9) + (5-3)(-15+9)}{5-1}

= \frac{(-2)(6) + (-1)(3) + (0)(0) + (1)(-3) + (2)(-6)}{4}

= \frac{-12 - 3 + 0 - 3 - 12}{4}

= \frac{-30}{4} = -7.5

**Calculate the standard deviations of X and Y:**

S_X = \sqrt{\frac{\sum (X_i - \bar{X})^2}{n-1}}

= \sqrt{\frac{(1-3)^2 + (2-3)^2 + (3-3)^2 + (4-3)^2 + (5-3)^2}{5-1}}

= \sqrt{\frac{4 + 1 + 0 + 1 + 4}{4}}

= \sqrt{\frac{10}{4}} = \sqrt{2.5}

S_Y = \sqrt{\frac{\sum (Y_i - \bar{Y})^2}{n-1}}

= \sqrt{\frac{(-3+9)^2 + (-6+9)^2 + (-9+9)^2 + (-12+9)^2 + (-15+9)^2}{5-1}}

= \sqrt{\frac{36 + 9 + 0 + 9 + 36}{4}}

= \sqrt{\frac{90}{4}} = \sqrt{22.5}

**Calculate the correlation coefficient:**

r = \frac{Cov(X, Y)}{S_X \cdot S_Y}

= \frac{-7.5}{\sqrt{2.5} \cdot \sqrt{22.5}}

= \frac{-7.5}{\sqrt{56.25}} = \frac{-7.5}{7.5} = -1

Therefore, the correlation coefficient for the given data set is -1, indicating a perfect negative linear relationship.

Step by step solution:

Given data set:

X = \{0, 1, 2, 3, 4\}

Y = \{1, 2, 4, 8, 16\}

**Calculate the means of X and Y:**

\bar{X} = \frac{0 + 1 + 2 + 3 + 4}{5} = 2

\bar{Y} = \frac{1 + 2 + 4 + 8 + 16}{5} = 6.2

**Calculate the covariance:**

Cov(X, Y) = \frac{\sum (X_i - \bar{X})(Y_i - \bar{Y})}{n-1}

= \frac{(0-2)(1-6.2) + (1-2)(2-6.2) + (2-2)(4-6.2) + (3-2)(8-6.2) + (4-2)(16-6.2)}{5-1}

= \frac{(-2)(-5.2) + (-1)(-4.2) + 0(-2.2) + (1)(1.8) + (2)(9.8)}{4}

= \frac{10.4 + 4.2 + 0 + 1.8 + 19.6}{4}

= \frac{36}{4} = 9

**Calculate the standard deviations of X and Y:**

S_X = \sqrt{\frac{\sum (X_i - \bar{X})^2}{n-1}}

= \sqrt{\frac{(0-2)^2 + (1-2)^2 + (2-2)^2 + (3-2)^2 + (4-2)^2}{5-1}}

= \sqrt{\frac{4 + 1 + 0 + 1 + 4}{4}}

= \sqrt{\frac{10}{4}} = \sqrt{2.5}

S_Y = \sqrt{\frac{\sum (Y_i - \bar{Y})^2}{n-1}}

= \sqrt{\frac{(1-6.2)^2 + (2-6.2)^2 + (4-6.2)^2 + (8-6.2)^2 + (16-6.2)^2}{5-1}}

= \sqrt{\frac{25.44 + 16.84 + 4.84 + 2.24 + 92.16}{4}}

= \sqrt{\frac{141.52}{4}} = \sqrt{35.38}[/latex

More Worked Examples on Correlation coefficient
It Sticks!

1. Find the correlation coefficient for the points (3, 5), (7, 10), (1, 4).

2. Given a correlation coefficient of -0.6, determine the strength and direction of the relationship between two variables.

3. Calculate the correlation coefficient for the data set: {12, 14, 15, 20, 18} and {5, 7, 8, 12, 10}.

4. If the correlation coefficient is 0.8, what does this suggest about the relationship between the variables?

5. Determine the correlation coefficient for the scatter plot with points (2, 4), (5, 8), (7, 14), and (10, 16).

6. What does a correlation coefficient of 1 indicate about the relationship between two variables?

7. Calculate the correlation coefficient for the data set: {25, 30, 40, 50, 60} and {10, 15, 20, 25, 30}.

8. Given a correlation coefficient of -0.3, determine the strength and direction of the relationship between two variables.

9. Find the correlation coefficient for the points (1, 3), (4, 7), (2, 5), and (6, 12).

10. If the correlation coefficient is -0.9, what does this suggest about the relationship between the variables?

11. Determine the correlation coefficient for the scatter plot with points (3, 6), (6, 12), (9, 18), and (12, 22).

12. What does a correlation coefficient of 0 indicate about the relationship between two variables?

13. Calculate the correlation coefficient for the data set: {8, 12, 14, 18, 20} and {4, 6, 7, 9, 10}.

14. Given a correlation coefficient of 0.5, determine the strength and direction of the relationship between two variables.

15. Find the correlation coefficient for the points (2, 5), (4, 9), (6, 12), and (8, 16).

1. 0.9856

2. Strong negative correlation

3. 0.9781

4. Strong positive correlation

5. 0.9974

6. Perfect positive correlation

7. 0.9977

8. Weak negative correlation

9. 0.9981

10. Strong negative correlation

11. 0.9971

12. No linear relationship

13. 0.9999

14. Moderate positive correlation

15. 0.9994

Quick Answers for Correlation coefficient
It Sticks!