Correlation Coefficient Notes

Published on: November 26, 2026

These Correlation Coefficient Notes explain how to measure how closely paired data follows a straight line, with the working shown line by line. The method finds the mean of the x values and of the y values, takes them away from each value, and multiplies and squares those differences. The totals go into the formula, which always gives a value between -1 and 1. Values near 1 or -1 mean a strong straight-line pattern, and values near 0 mean almost none. A scatter plot then shows the points.

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the x values and of the y values.
  4. Subtract the means from each value.
  5. Multiply and square the differences.
  6. Add up the three new columns.
  7. Substitute the totals into the formula.
  8. Work out r.
  9. Show the points on a scatter plot.

Formula: Correlation Coefficient Formula

This formula measures how closely the points follow a straight line. Divide the total of the products by the square root of the two squared totals multiplied together.

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Useful Tips to Remember

The correlation coefficient \(r\) is always between \(-1\) and 1. Values near 1 show a strong positive link, values near \(-1\) a strong negative link, and values near 0 little or no straight-line link. Correlation does not prove that one variable causes the other. It only measures straight-line patterns, so always look at a scatter graph too.

Required knowledge

Where Is the Correlation Coefficient Used?

The correlation coefficient \(r\) measures how strongly two quantities move together in a straight-line pattern, on a scale from \(-1\) to \(1\). Researchers use it to check links such as height and weight, study time and exam scores, or advertising spend and sales. Investors use it to see whether two stocks rise and fall together, which helps spread risk across a portfolio. A strong correlation does not prove that one thing causes the other, but it shows which relationships are worth investigating further.

  • Checking the link between study time and exam results
  • Measuring how closely two stocks move together
  • Testing whether advertising spend relates to sales
  • Exploring links between lifestyle and health in research
  • Checking whether two measurements of the same thing agree

Correlation Coefficient Practice Problems

Example 1 has a positive link between \(x\) and \(y\), and Example 2 has a negative one. Examples 3 and 4 give you two more problems of the same kind to try. Try working out \(r\) for each table yourself before checking the steps.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. Try each problem on paper first, then open the example and check your working one step at a time, so you can see exactly which step went wrong if your answer does not match. Use them to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(\begin{array}{c|c} x & y \\ \hline 1 & 2 \\ 2 & 4 \\ 3 & 5 \\ 4 & 4 \\ 5 & 5 \end{array}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the x values and of the y values.
  4. Subtract the means from each value.
  5. Multiply and square the differences.
  6. Add up the three new columns.
  7. Substitute the totals into the formula.
  8. Work out r.
  9. Show the points on a scatter plot.

Formula

Formula: Correlation Coefficient Formula

This formula measures how closely the points follow a straight line. Divide the total of the products by the square root of the two squared totals multiplied together.

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are measuring how closely the points \((x, y)\) follow a straight line.

\(\begin{array}{c|c} x & y \\ \hline 1 & 2 \\ 2 & 4 \\ 3 & 5 \\ 4 & 4 \\ 5 & 5 \end{array}\)

Step 2

Step 2 - Write the formula.

In this problem: The top measures how x and y move together, and the bottom scales it so r is always between \(-1\) and \(1\).

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 3

Step 3 - Find the mean of the x values and of the y values.

In this problem: Both means are needed before the differences can be found.

\(x: 1,\; 2,\; 3,\; 4,\; 5 \qquad y: 2,\; 4,\; 5,\; 4,\; 5\)

Step 3a

Step 3a - Find the mean of the x values.

In this problem: The mean of the x values is \(\bar{x} = 3\).

\(\bar{x} = 3\)

Step 3b

Step 3b - Find the mean of the y values.

In this problem: The mean of the y values is \(\bar{y} = 4\).

\(\bar{y} = 4\)

Step 4

Step 4 - Subtract the means from each value.

In this problem: Taking \(\bar{x} = 3\) from each x value and \(\bar{y} = 4\) from each y value gives the differences.

\(\begin{array}{c|c|c|c} x & y & x - \bar{x} & y - \bar{y} \\ \hline 1 & 2 & -2 & -2 \\ 2 & 4 & -1 & 0 \\ 3 & 5 & 0 & 1 \\ 4 & 4 & 1 & 0 \\ 5 & 5 & 2 & 1 \end{array}\)

Step 5

Step 5 - Multiply and square the differences.

In this problem: Each row's two differences are multiplied together, and each difference is squared.

\(\begin{array}{c|c|c|c|c} x - \bar{x} & y - \bar{y} & (x - \bar{x})(y - \bar{y}) & (x - \bar{x})^{2} & (y - \bar{y})^{2} \\ \hline -2 & -2 & 4 & 4 & 4 \\ -1 & 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 & 1 \\ 1 & 0 & 0 & 1 & 0 \\ 2 & 1 & 2 & 4 & 1 \end{array}\)

Step 6

Step 6 - Add up the three new columns.

In this problem: The formula needs the total of each of the three new columns.

\(\Sigma (x - \bar{x})(y - \bar{y}),\; \Sigma (x - \bar{x})^{2},\; \Sigma (y - \bar{y})^{2}\)

Step 6a

Step 6a - Add the products.

In this problem: Adding the column gives \(4 + 0 + 0 + 0 + 2 = 6\).

\(\Sigma (x - \bar{x})(y - \bar{y}) = 4 + 0 + 0 + 0 + 2 = 6\)

Step 6b

Step 6b - Add the squared x differences.

In this problem: Adding the column gives \(4 + 1 + 0 + 1 + 4 = 10\).

\(\Sigma (x - \bar{x})^{2} = 4 + 1 + 0 + 1 + 4 = 10\)

Step 6c

Step 6c - Add the squared y differences.

In this problem: Adding the column gives \(4 + 0 + 1 + 0 + 1 = 6\).

\(\Sigma (y - \bar{y})^{2} = 4 + 0 + 1 + 0 + 1 = 6\)

Step 7

Step 7 - Substitute the totals into the formula.

In this problem: Replacing the three totals gives \(r = \frac{6}{\sqrt{10 \times 6}}\).

\(r = \frac{6}{\sqrt{10 \times 6}}\)

Step 8

Step 8 - Work out r.

In this problem: Multiplying under the square root, taking the root and dividing gives \(r \approx 0.7746\). This is a strong positive linear relationship.

\(r = \frac{6}{\sqrt{10 \times 6}} \approx 0.7746\)

Step 9

Step 9 - Show the points on a scatter plot.

In this problem: The dashed lines are the two means. Points in the top right and bottom left push r up, and points in the other two corners push it down.

Scatter plot of the points

Final Answer

\(r \approx 0.7746\)
See Example 2 Hide Example 2

Problem

\(\begin{array}{c|c} x & y \\ \hline 1 & 8 \\ 2 & 6 \\ 3 & 5 \\ 4 & 1 \end{array}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the x values and of the y values.
  4. Subtract the means from each value.
  5. Multiply and square the differences.
  6. Add up the three new columns.
  7. Substitute the totals into the formula.
  8. Work out r.
  9. Show the points on a scatter plot.

Formula

Formula: Correlation Coefficient Formula

This formula measures how closely the points follow a straight line. Divide the total of the products by the square root of the two squared totals multiplied together.

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are measuring how closely the points \((x, y)\) follow a straight line.

\(\begin{array}{c|c} x & y \\ \hline 1 & 8 \\ 2 & 6 \\ 3 & 5 \\ 4 & 1 \end{array}\)

Step 2

Step 2 - Write the formula.

In this problem: The top measures how x and y move together, and the bottom scales it so r is always between \(-1\) and \(1\).

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 3

Step 3 - Find the mean of the x values and of the y values.

In this problem: Both means are needed before the differences can be found.

\(x: 1,\; 2,\; 3,\; 4 \qquad y: 8,\; 6,\; 5,\; 1\)

Step 3a

Step 3a - Find the mean of the x values.

In this problem: The mean of the x values is \(\bar{x} = 2.5\).

\(\bar{x} = 2.5\)

Step 3b

Step 3b - Find the mean of the y values.

In this problem: The mean of the y values is \(\bar{y} = 5\).

\(\bar{y} = 5\)

Step 4

Step 4 - Subtract the means from each value.

In this problem: Taking \(\bar{x} = 2.5\) from each x value and \(\bar{y} = 5\) from each y value gives the differences.

\(\begin{array}{c|c|c|c} x & y & x - \bar{x} & y - \bar{y} \\ \hline 1 & 8 & -1.5 & 3 \\ 2 & 6 & -0.5 & 1 \\ 3 & 5 & 0.5 & 0 \\ 4 & 1 & 1.5 & -4 \end{array}\)

Step 5

Step 5 - Multiply and square the differences.

In this problem: Each row's two differences are multiplied together, and each difference is squared.

\(\begin{array}{c|c|c|c|c} x - \bar{x} & y - \bar{y} & (x - \bar{x})(y - \bar{y}) & (x - \bar{x})^{2} & (y - \bar{y})^{2} \\ \hline -1.5 & 3 & -4.5 & 2.25 & 9 \\ -0.5 & 1 & -0.5 & 0.25 & 1 \\ 0.5 & 0 & 0 & 0.25 & 0 \\ 1.5 & -4 & -6 & 2.25 & 16 \end{array}\)

Step 6

Step 6 - Add up the three new columns.

In this problem: The formula needs the total of each of the three new columns.

\(\Sigma (x - \bar{x})(y - \bar{y}),\; \Sigma (x - \bar{x})^{2},\; \Sigma (y - \bar{y})^{2}\)

Step 6a

Step 6a - Add the products.

In this problem: Adding the column gives \(-4.5 + \left(-0.5\right) + 0 + \left(-6\right) = -11\).

\(\Sigma (x - \bar{x})(y - \bar{y}) = -4.5 + \left(-0.5\right) + 0 + \left(-6\right) = -11\)

Step 6b

Step 6b - Add the squared x differences.

In this problem: Adding the column gives \(2.25 + 0.25 + 0.25 + 2.25 = 5\).

\(\Sigma (x - \bar{x})^{2} = 2.25 + 0.25 + 0.25 + 2.25 = 5\)

Step 6c

Step 6c - Add the squared y differences.

In this problem: Adding the column gives \(9 + 1 + 0 + 16 = 26\).

\(\Sigma (y - \bar{y})^{2} = 9 + 1 + 0 + 16 = 26\)

Step 7

Step 7 - Substitute the totals into the formula.

In this problem: Replacing the three totals gives \(r = \frac{-11}{\sqrt{5 \times 26}}\).

\(r = \frac{-11}{\sqrt{5 \times 26}}\)

Step 8

Step 8 - Work out r.

In this problem: Multiplying under the square root, taking the root and dividing gives \(r \approx -0.9648\). This is a strong negative linear relationship.

\(r = \frac{-11}{\sqrt{5 \times 26}} \approx -0.9648\)

Step 9

Step 9 - Show the points on a scatter plot.

In this problem: The dashed lines are the two means. Points in the top right and bottom left push r up, and points in the other two corners push it down.

Scatter plot of the points

Final Answer

\(r \approx -0.9648\)
See Example 3 Hide Example 3

Problem

\(\begin{array}{c|c} x & y \\ \hline 10 & 15 \\ 20 & 18 \\ 30 & 30 \\ 40 & 41 \end{array}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the x values and of the y values.
  4. Subtract the means from each value.
  5. Multiply and square the differences.
  6. Add up the three new columns.
  7. Substitute the totals into the formula.
  8. Work out r.
  9. Show the points on a scatter plot.

Formula

Formula: Correlation Coefficient Formula

This formula measures how closely the points follow a straight line. Divide the total of the products by the square root of the two squared totals multiplied together.

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are measuring how closely the points \((x, y)\) follow a straight line.

\(\begin{array}{c|c} x & y \\ \hline 10 & 15 \\ 20 & 18 \\ 30 & 30 \\ 40 & 41 \end{array}\)

Step 2

Step 2 - Write the formula.

In this problem: The top measures how x and y move together, and the bottom scales it so r is always between \(-1\) and \(1\).

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 3

Step 3 - Find the mean of the x values and of the y values.

In this problem: Both means are needed before the differences can be found.

\(x: 10,\; 20,\; 30,\; 40 \qquad y: 15,\; 18,\; 30,\; 41\)

Step 3a

Step 3a - Find the mean of the x values.

In this problem: The mean of the x values is \(\bar{x} = 25\).

\(\bar{x} = 25\)

Step 3b

Step 3b - Find the mean of the y values.

In this problem: The mean of the y values is \(\bar{y} = 26\).

\(\bar{y} = 26\)

Step 4

Step 4 - Subtract the means from each value.

In this problem: Taking \(\bar{x} = 25\) from each x value and \(\bar{y} = 26\) from each y value gives the differences.

\(\begin{array}{c|c|c|c} x & y & x - \bar{x} & y - \bar{y} \\ \hline 10 & 15 & -15 & -11 \\ 20 & 18 & -5 & -8 \\ 30 & 30 & 5 & 4 \\ 40 & 41 & 15 & 15 \end{array}\)

Step 5

Step 5 - Multiply and square the differences.

In this problem: Each row's two differences are multiplied together, and each difference is squared.

\(\begin{array}{c|c|c|c|c} x - \bar{x} & y - \bar{y} & (x - \bar{x})(y - \bar{y}) & (x - \bar{x})^{2} & (y - \bar{y})^{2} \\ \hline -15 & -11 & 165 & 225 & 121 \\ -5 & -8 & 40 & 25 & 64 \\ 5 & 4 & 20 & 25 & 16 \\ 15 & 15 & 225 & 225 & 225 \end{array}\)

Step 6

Step 6 - Add up the three new columns.

In this problem: The formula needs the total of each of the three new columns.

\(\Sigma (x - \bar{x})(y - \bar{y}),\; \Sigma (x - \bar{x})^{2},\; \Sigma (y - \bar{y})^{2}\)

Step 6a

Step 6a - Add the products.

In this problem: Adding the column gives \(165 + 40 + 20 + 225 = 450\).

\(\Sigma (x - \bar{x})(y - \bar{y}) = 165 + 40 + 20 + 225 = 450\)

Step 6b

Step 6b - Add the squared x differences.

In this problem: Adding the column gives \(225 + 25 + 25 + 225 = 500\).

\(\Sigma (x - \bar{x})^{2} = 225 + 25 + 25 + 225 = 500\)

Step 6c

Step 6c - Add the squared y differences.

In this problem: Adding the column gives \(121 + 64 + 16 + 225 = 426\).

\(\Sigma (y - \bar{y})^{2} = 121 + 64 + 16 + 225 = 426\)

Step 7

Step 7 - Substitute the totals into the formula.

In this problem: Replacing the three totals gives \(r = \frac{450}{\sqrt{500 \times 426}}\).

\(r = \frac{450}{\sqrt{500 \times 426}}\)

Step 8

Step 8 - Work out r.

In this problem: Multiplying under the square root, taking the root and dividing gives \(r \approx 0.975\). This is a strong positive linear relationship.

\(r = \frac{450}{\sqrt{500 \times 426}} \approx 0.975\)

Step 9

Step 9 - Show the points on a scatter plot.

In this problem: The dashed lines are the two means. Points in the top right and bottom left push r up, and points in the other two corners push it down.

Scatter plot of the points

Final Answer

\(r \approx 0.975\)
See Example 4 Hide Example 4

Problem

\(\begin{array}{c|c} x & y \\ \hline 2 & 3 \\ 4 & 7 \\ 6 & 5 \\ 8 & 11 \\ 10 & 14 \end{array}\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Write the formula.
  3. Find the mean of the x values and of the y values.
  4. Subtract the means from each value.
  5. Multiply and square the differences.
  6. Add up the three new columns.
  7. Substitute the totals into the formula.
  8. Work out r.
  9. Show the points on a scatter plot.

Formula

Formula: Correlation Coefficient Formula

This formula measures how closely the points follow a straight line. Divide the total of the products by the square root of the two squared totals multiplied together.

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 1

Step 1 - Set up the problem.

In this problem: We are measuring how closely the points \((x, y)\) follow a straight line.

\(\begin{array}{c|c} x & y \\ \hline 2 & 3 \\ 4 & 7 \\ 6 & 5 \\ 8 & 11 \\ 10 & 14 \end{array}\)

Step 2

Step 2 - Write the formula.

In this problem: The top measures how x and y move together, and the bottom scales it so r is always between \(-1\) and \(1\).

\(r = \frac{\Sigma (x - \bar{x})(y - \bar{y})}{\sqrt{\Sigma (x - \bar{x})^{2} \times \Sigma (y - \bar{y})^{2}}}\)

Step 3

Step 3 - Find the mean of the x values and of the y values.

In this problem: Both means are needed before the differences can be found.

\(x: 2,\; 4,\; 6,\; 8,\; 10 \qquad y: 3,\; 7,\; 5,\; 11,\; 14\)

Step 3a

Step 3a - Find the mean of the x values.

In this problem: The mean of the x values is \(\bar{x} = 6\).

\(\bar{x} = 6\)

Step 3b

Step 3b - Find the mean of the y values.

In this problem: The mean of the y values is \(\bar{y} = 8\).

\(\bar{y} = 8\)

Step 4

Step 4 - Subtract the means from each value.

In this problem: Taking \(\bar{x} = 6\) from each x value and \(\bar{y} = 8\) from each y value gives the differences.

\(\begin{array}{c|c|c|c} x & y & x - \bar{x} & y - \bar{y} \\ \hline 2 & 3 & -4 & -5 \\ 4 & 7 & -2 & -1 \\ 6 & 5 & 0 & -3 \\ 8 & 11 & 2 & 3 \\ 10 & 14 & 4 & 6 \end{array}\)

Step 5

Step 5 - Multiply and square the differences.

In this problem: Each row's two differences are multiplied together, and each difference is squared.

\(\begin{array}{c|c|c|c|c} x - \bar{x} & y - \bar{y} & (x - \bar{x})(y - \bar{y}) & (x - \bar{x})^{2} & (y - \bar{y})^{2} \\ \hline -4 & -5 & 20 & 16 & 25 \\ -2 & -1 & 2 & 4 & 1 \\ 0 & -3 & 0 & 0 & 9 \\ 2 & 3 & 6 & 4 & 9 \\ 4 & 6 & 24 & 16 & 36 \end{array}\)

Step 6

Step 6 - Add up the three new columns.

In this problem: The formula needs the total of each of the three new columns.

\(\Sigma (x - \bar{x})(y - \bar{y}),\; \Sigma (x - \bar{x})^{2},\; \Sigma (y - \bar{y})^{2}\)

Step 6a

Step 6a - Add the products.

In this problem: Adding the column gives \(20 + 2 + 0 + 6 + 24 = 52\).

\(\Sigma (x - \bar{x})(y - \bar{y}) = 20 + 2 + 0 + 6 + 24 = 52\)

Step 6b

Step 6b - Add the squared x differences.

In this problem: Adding the column gives \(16 + 4 + 0 + 4 + 16 = 40\).

\(\Sigma (x - \bar{x})^{2} = 16 + 4 + 0 + 4 + 16 = 40\)

Step 6c

Step 6c - Add the squared y differences.

In this problem: Adding the column gives \(25 + 1 + 9 + 9 + 36 = 80\).

\(\Sigma (y - \bar{y})^{2} = 25 + 1 + 9 + 9 + 36 = 80\)

Step 7

Step 7 - Substitute the totals into the formula.

In this problem: Replacing the three totals gives \(r = \frac{52}{\sqrt{40 \times 80}}\).

\(r = \frac{52}{\sqrt{40 \times 80}}\)

Step 8

Step 8 - Work out r.

In this problem: Multiplying under the square root, taking the root and dividing gives \(r \approx 0.9192\). This is a strong positive linear relationship.

\(r = \frac{52}{\sqrt{40 \times 80}} \approx 0.9192\)

Step 9

Step 9 - Show the points on a scatter plot.

In this problem: The dashed lines are the two means. Points in the top right and bottom left push r up, and points in the other two corners push it down.

Scatter plot of the points

Final Answer

\(r \approx 0.9192\)

Calculator and Practice Mode