Skip to content

Covariance and correlation

Compute the covariance and the correlation coefficient of two variables from a table of products, read r from a scatter plot, and say why correlation is not causation.

It opens on

For five products, are the ones with above-average advertising spend also the ones with above-average sales, or below-average sales?

Why it matters

Budgets, forecasts and risk models all rest on how strongly two business variables move together, and a single number r says it without units.

Good to know first

  • scatter plot

Step by step

  1. Covariance

    Compute a sample covariance from the products of paired deviations and read its sign.

    A common mix-up

    A covariance of 27 is large, so the link is strong.

    In fact: Its size depends on the units, so a covariance alone cannot say how strong the link is.

  2. The correlation coefficient

    Compute the correlation coefficient r from the covariance and the two standard deviations and say what its value means.

    For advertising the squared deviations are 16, 4, 0, 4 and 16, so sx² = 40 / 4 = 10 and sx = 3.16.

    sx = √10 = 3.16

    A common mix-up

    r = 0.946 means 94.6% of the dots are on the line.

    In fact: r is a measure of how closely the dots follow a line, not a percent of dots on it.

  3. Reading r and its limits

    Interpret r for strength and direction, see that r misses curved patterns, and explain why correlation does not show causation.

    A common mix-up

    A high correlation shows that one variable causes the other.

    In fact: A third factor can drive both, so correlation alone never shows cause.

Try it

Four stores have prices 1, 2, 3 and 4 dollars and weekly sales 8, 6, 5 and 1 hundred units. Find the covariance.Answer

Means 2.5 and 5, products −4.5, −0.5, 0 and −6 add to −11, and −11 / 3 = −3.67

Hint: Means first, then products

For the four stores of the last try, sx = 1.29 and sy = 2.94. Find r.Answer

−3.667 / (1.291 × 2.944) = −0.965

Hint: Divide the covariance by both standard deviations

A study finds r = −0.85 between the price of a product and units sold. Describe the relationship in one sentence.Answer

a strong negative straight-line link, higher prices going with fewer units sold

Hint: Say sign and strength

Another product spends 12 and sells 45. What is the product of its deviations from the same means?Answer

(12 − 6)(45 − 30) = 6 × 15 = 90

If sales were recorded in dollars, not thousands of dollars, would r change?Answer

No, since r has no units, though the covariance would be 1,000 times larger

Covariance and correlation

30 minutes every month. No card.