KS Maths
Year 11 Extended ยท Unit 5 Sampling, correlation and regression ยท Lesson 2 of 5

Covariance

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

Words you need (10 key words in this lesson)

The maths words this lesson uses, in plain English. Open this before you start if English is not your first language.

mean
The total of all values divided by how many values there are.The mean of 2, 4, 6 is 4.
positive
Greater than zero.7 is a positive number.
negative
Less than zero. A negative number has a minus sign.Minus 4 is a negative number.
multiply
Add the same number many times. Find a product.3 multiplied by 4 is 12.
sample
A small group chosen from a bigger group.We asked a sample of 50 students.
standard deviation
A number that shows how far data are from the mean on average.A small standard deviation means data are close together.
less than
Not as big as. The sign is <.3 is less than 5.
scatter graph
A graph of points that shows if two things are linked.A scatter graph of height and weight.
divide
Share into equal parts, or find how many times one number fits in another.12 divided by 4 is 3.
trend
The general direction that data move over time.The trend is going up.

Preview You are reading the start of this lesson. The rest opens with a plan. See plans Already paid? Sign in

Warm-up

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

  1. From Year 8: 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.

02468101204812x, hours openy, loaves sold (hundreds)
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?

02468101204812x, hours openy, hundreds of loaves
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 50. 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.

The rest of this lesson is in the full course

Still to come in this lesson:

  • Worked examples
  • Check before you go on
  • Your turn

In the full lesson every figure moves as you drag it, and every answer you type is checked, with a note on what each wrong answer means.

Years 7 to 11 plan$59Every lesson from Year 7 to Year 11, so the refresher links always open, and every Year 7 to 11 revision pack, for the whole family. $59 for 12 months or $99 for 2 years.
IB Diploma plan$99Every lesson from Year 7 to the IB Diploma, AA and AI, SL and HL, for the whole family. $99 for 12 months or $149 for 2 years.

One plan opens every Diploma lesson, AA and AI, SL and HL, for the whole family.

One payment. Nothing renews. Full refund within 30 days. Prices are in US$; Gumroad shows your local currency at checkout. Pay by card on Gumroad, then come back here and type the email you paid with: we email you a sign-in link. For a refund, reply to your Gumroad receipt or email hello@ksmaths.com.

Try a free sample lesson in every unit, and the whole Skill Tree. See this unit.

Already have a revision pack or the Years 7 to 11 plan? Move up and the unused part of what you paid comes off.

Teaching students who need extra support? Student codes for 5, 10 or 30 students.

Year 11 revision pack, $19BuyPlan $59