Year 11 Extended · Unit 5 Sampling, correlation and regression · Lesson 2 of 5

Covariance: one number for how two variables move together

Each dot sits to the left or right of the mean of x and above or below the mean of y. This lesson turns those two distances into one number for the whole data set, and asks what its sign and its size can, and cannot, tell you.

Statistics and ProbabilityNo calculator

Warm-up

Three quick ones from earlier work. Try each in your head or on paper before you open the answer.

  1. A set of x values is 3, 5, 6, 10. What is the mean?
    Answer6, because 24 ÷ 4 = 6.
  2. From Year 9: the dots on a scatter graph rise from bottom left to top right in a narrow band. Is the correlation positive or negative, strong or weak?
    AnswerPositive and strong.
  3. From Lesson 1: why does a larger sample give a narrower range of possible sample means?
    AnswerMore values are averaged, so a few extreme values are diluted; with the whole population there is only one answer.
Words used in this lesson
mean point
the point whose coordinates are the mean of x and the mean of y. For example: the point where the two dashed lines cross.
deviation
how far a value is from its mean, with a sign. For example: a stall that is open 2 hours less than the mean has dx = −2.
product
the result of multiplying two numbers. For example: dx multiplied by dy for one dot.
covariance
the mean of the products dx × dy over all the dots. For example: the number that is positive when the dots rise.
quadrant
one of four regions made by the lines through the mean point. For example: the top-left region.

Five market stalls

A market official records, for five stalls, x, the hours the stall stays open, and y, the loaves it sells in hundreds. The mean of the x values is 6 hours and the mean of the y values is also 6. Call that point (6, 6) the mean point. For each dot, measure how far it is across from the mean point, dx = x − mean of x, and how far up, dy = y − mean of y.

Predict first: a dot in the top-right quadrant has dx positive and dy positive. What is the sign of its product dx × dy, and what is the sign for a dot in the top-left quadrant? Test it, and watch which patterns make most products positive.

1
16product for this dot
16running total of the products
8covariance of all five dots

Rising pattern, dot 1 at (2, 2): dx = −4, dy = −4, so the product is 16. Running total 16. Covariance of all five dots: 8.

Show me the steps
  1. Rising, dot 1 at (2, 2): it is 4 left of the mean x and 4 below the mean y, so dx = −4, dy = −4 and the product is (−4) × (−4) = 16. Positive.
  2. Rising, dot 3 at (6, 5): its x is the mean of x, so dx = 0 and the product is 0 whatever dy is.
  3. Rising, dot 5 at (10, 11): the five products add to 16 + 2 + 0 + 2 + 20 = 40 and 40 ÷ 5 = 8. Positive covariance.
  4. Falling, dot 1 at (2, 11): dx = −4, dy = 5, product −20. Negative. The total of all five is −40, so the covariance is −8.
  5. Scattered, dot 5: the positive and negative products cancel, total 0, covariance 0. There is no straight-line trend, though the dots are not all alike.

Covariance is the mean of the products dx × dy.

  • A dot in the top-right or bottom-left quadrant has a positive product; in the other two quadrants it is negative. A dot on a dashed line has product 0.
  • Covariance = (sum of dx × dy) ÷ n. Positive: the variables tend to rise together. Negative: one rises as the other falls. Zero: no straight-line trend. (Covariance here divides by n. Some calculators divide by n − 1, as for a sample standard deviation; the sign is the same, and r in Lesson 3 comes out the same either way.)
  • The size of the covariance carries the units of x and of y. Measure y in different units and it changes, though the dots have not moved.

Now keep the dots in place and change only the unit of y. Predict: will the covariance change, and if so by how much?

11y of the highest dot
8covariance of the five dots

y in hundreds of loaves: the highest dot is at y = 11 and the covariance is 8.

Show me the steps
  1. y in hundreds of loaves: the highest dot is at 11 and the covariance of the five dots is 8.
  2. y in single loaves: every y is multiplied by 100, so every dy is multiplied by 100 and so is every product. The highest dot is at 1100 and the covariance is 800. The picture has not changed.

Two data sets have covariances of 8 and 40. What else would you need to know before saying which link is stronger? The first figure above and the unit change just now are worth a second look.

Worked examples

Four dots are (1, 3), (2, 7), (4, 9) and (5, 13). Find the covariance.

  1. The mean of x is 12 ÷ 4 = 3 and the mean of y is 32 ÷ 4 = 8.
  2. The deviations: dx = −2, −1, 1, 2 and dy = −5, −1, 1, 5.
  3. The products: 10, 1, 1 and 10, which total 22. The covariance is 22 ÷ 4 = 5.5. Positive: the dots rise.

Three dots are (10, 9), (20, 6) and (30, 3). Find the covariance and say what its sign shows.

  1. The means are 20 and 6, so dx = −10, 0, 10 and dy = 3, 0, −3.
  2. The products are −30, 0 and −30, which total −60, so the covariance is −60 ÷ 3 = −20.
  3. It is negative because y falls as x rises. Its size, 20, depends on the units of x and y.

Your go. The first step is given. Four dots are (1, 5), (2, 6), (3, 7) and (6, 10). Find the covariance.

  1. The mean of x is 12 ÷ 4 = 3.
  2. Find the mean of y, then dx and dy for each dot, then the four products and their mean.
Check the answer

The mean of y is 28 ÷ 4 = 7. dx = −2, −1, 0, 3 and dy = −2, −1, 0, 3. The products are 4, 1, 0 and 9, a total of 14, and the covariance is 14 ÷ 4 = 3.5. A common slip is to divide the total of the products by 3, the number of dots that are not on the mean x, instead of by 4.

Check before you go on

1. Five dots are marked about their mean point. Three lie in the top-right or bottom-left quadrants, with products 6, 4 and 2. Two lie in the other quadrants, with products −10 and −8. What is the sign of the covariance?

Your turn

Start at Level 1 and go as far as you can. Type negative numbers with a minus sign, for example -7. A wrong answer gets a reason, not just a cross: read it, then try again.

Level 1 · Getting started

2. The mean point of a data set is (12, 40). A dot is at (15, 46). What is its product dx × dy?

3. The mean point of a data set is (12, 40). A dot is at (9, 52). What is its product dx × dy?

Level 2 · Building

4. Four dots are (1, 3), (3, 6), (5, 5) and (7, 10). Find the covariance.

5. Two variables have a covariance of 6. Every y value is then multiplied by 3 (the x values are unchanged). What is the new covariance?

Level 3 · Stretch

6. Four dots have x values 2, 4, 6 and 8 and y values 14, 10, k and 6. The covariance is −7. Find k. (Hint: the deviations dx add to 0, so the sum of dx × dy equals the sum of dx × y.)

Something to think about

A class measures the arm span and the height of 30 students in centimetres and finds a covariance of 62. A second class measures the same students in metres. Without calculating, what do you expect the new covariance to be, and what does it tell you about the strength of the link?

One way to think about it

Both lengths are divided by 100, so every deviation is divided by 100 and every product by 10 000: the covariance becomes 0.0062. Not one student has changed and the dots make exactly the same picture, so the link is exactly as strong as before, although the number is 10 000 times smaller.

Exit ticket

7. In one class the covariance of height (cm) and mass (kg) is 40. In another study the covariance of income and savings, both in rupees, is 900 000. A student says savings and income are more strongly linked because 900 000 is larger. Which reply is right?