# Correlation coefficient: how two metrics move together

> Measuring how two metrics move together with the correlation coefficient (Pearson and Spearman), and why that alone proves nothing about cause.

- Course: [Statistics for Product Managers and Marketers](https://productovi.com/courses/statistics-for-pm-and-marketers.md)
- Module: Relationships
- Lesson 17/24, ~45 min
- Source: https://productovi.com/courses/statistics-for-pm-and-marketers/correlation

## Do ads even work?

**Alex Tutor:** Morning. Last week you asked whether raising the ad budget actually gets CatChow more orders, a fair question for anyone on the product team. Let's find out with real numbers instead of vibes.

**Sofia:** Isn't that obvious? More money in, more orders out. Case closed, right?

**Alex Tutor:** Nothing in analytics is "obvious" until you've looked at the data. Let's pull ten weeks of ad spend and orders from ads, and by the end you'll sum up their link in one number: the correlation coefficient.

![A cartoon cat beside a laptop, with an orange megaphone spilling coins on one side and a stack of cat-food boxes on the other, joined by a dotted path.](https://productovi.com/courses/statistics-for-pm-and-marketers/inline/correlation-illustration-2.webp)

*The question of the day: when CatChow spends more on ads, do orders follow?*

**Dataset (CSV):** [CatChow weekly ad spend and orders from ads](https://productovi.com/datasets/statistics-for-pm-and-marketers/correlation/catchow-ad-spend-orders.csv)

Ten weeks of weekly ad spend and the orders attributed to ads. Synthetic data made for this course; reused in the next lesson.

- `week`: Week number
- `ad_spend_usd`: Weekly ad spend, USD
- `orders_from_ads`: Orders attributed to ads that week

**Alex Tutor:** Each row is one week: how much we spent on ads, and how many orders that week's ads got credited with.

**Sofia:** So I just... eyeball it and see if it goes up?

**Ad spend vs orders from ads, 10 weeks**

| Ad spend, USD | Orders from ads |
| --- | --- |
| 200 | 20 |
| 300 | 23 |
| 350 | 30 |
| 400 | 28 |
| 450 | 36 |
| 500 | 33 |
| 550 | 42 |
| 600 | 38 |
| 650 | 48 |
| 700 | 44 |

*Each dot is one week. Orders tend to be higher in weeks with more ad spend, but the dots don't sit on a perfect line.*

**Alex Tutor:** That's a scatter plot: one dot per week, spend on the x-axis, orders on the y-axis. Look for a general drift, not a perfect line.

**Sofia:** Okay, it clearly climbs up and to the right. So it IS a straight line — more spend always means more orders!

**Alex Tutor:** Close, but not quite. The dots drift upward, with real scatter around that drift. That drift is what we're about to measure precisely.

> **Exercise:** CatChow put 10 weeks of ads on a scatter plot: ad spend on the x-axis, orders from ads on the y-axis, one dot per week. The dots:
>
> | Week | Ad spend, USD | Orders from ads |
> |---|---|---|
> | 1 | 200 | 20 |
> | 2 | 300 | 23 |
> | 3 | 350 | 30 |
> | 4 | 400 | 28 |
> | 5 | 450 | 36 |
> | 6 | 500 | 33 |
> | 7 | 550 | 42 |
> | 8 | 600 | 38 |
> | 9 | 650 | 48 |
> | 10 | 700 | 44 |
>
> Which statement best describes the pattern?

**Alex Tutor:** Right — a drift with scatter. Now we need a single number that captures both the direction and the strength of that drift.

## How to calculate the correlation coefficient

**Sofia:** How do you even calculate a number like that?

**Alex Tutor:** For each week, take how far spend is from its average, and how far orders are from their average — two deviations per week.

**Alex Tutor:** Multiply the two deviations for each week. If both are usually positive together (or both negative together), the product is positive.

$$
\text{cov}(x,y) = \frac{1}{n-1}\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})
$$

*Covariance: the average product of deviations. Positive means the variables tend to move together; negative means they move oppositely.*

**Sofia:** What if some weeks go one way and some the other? Won't the pluses and minuses just cancel out?

**Alex Tutor:** If the relationship is real, one sign wins overall once you sum across all weeks. If spend and orders were unrelated, the sum would land near zero.

![Two pairs of cats on swings: on the left both cats swing up together, on the right one cat rises while the other drops.](https://productovi.com/courses/statistics-for-pm-and-marketers/inline/correlation-illustration-3.webp)

*Covariance asks one thing: do the two metrics tend to rise and fall together, or in opposite directions?*

> **Exercise:** If ad spend and orders from ads were completely unrelated, the sum of the deviation products across all weeks would land close to zero.

**Alex Tutor:** Covariance works, but its units are a mess — dollars times orders. We fix that by dividing by both variables' spread.

$$
r = \frac{\sum (x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum (x_i-\bar{x})^2 \sum (y_i-\bar{y})^2}}, \quad -1 \le r \le 1
$$

*Pearson correlation coefficient (r): covariance standardised to a fixed -1 to 1 scale, regardless of units.*

**Alex Tutor:** r = 1 is a perfect positive line, r = -1 a perfect negative line, r = 0 no linear relationship at all.

**Alex Tutor:** Before we talk about what counts as strong, a quick check on what that division does to units.

> **Exercise:** If CatChow recorded weekly ad spend in hryvnias instead of dollars, the Pearson correlation between ad spend and orders from ads would change.

**Sofia:** So what counts as a "good" r in the real world?

> **Rule of thumb for |r|**
>
> Below 0.3: weak. 0.3-0.7: moderate. Above 0.7: strong. These bands are informal and depend on your field — always look at the scatter plot too.

**Alex Tutor:** One trap with these bands: people read a minus sign as "weak". Try this one.

> **Exercise:** Across CatChow's cities, average delivery time and the share of customers who order again have r = −0.8. Which reading is **correct**?

**Alex Tutor:** Let's practice on a small example before touching the real dataset.

> **Exercise:** Five CatChow product pages show 1 to 5 customer reviews. Their conversion rates (%) are: 1 review -> 9%, 2 -> 8%, 3 -> 10%, 4 -> 11%, 5 -> 12%. Compute the Pearson correlation coefficient r between reviews shown and conversion rate.

**Alex Tutor:** Nicely done — and yes, r = 0.9 is strong. Real business data is rarely this tidy, though.

**Sofia:** So the ad-spend data won't be this clean?

**Alex Tutor:** Probably not — ten weeks include holidays, competitor moves, stock-outs. Let's compute r on the real dataset above and see.

**Alex Tutor:** Same Pearson formula, just ten weeks instead of five points. A spreadsheet's `CORREL()` function does the arithmetic for you.

**Sofia:** On it.

> **Exercise:** Using the dataset **CatChow weekly ad spend and orders from ads**, compute the Pearson correlation coefficient r between ad_spend_usd and orders_from_ads.

**Alex Tutor:** Strong positive relationship, confirmed with real numbers. But before you go tell the CFO "ads cause orders" — slow down.

**Sofia:** Wait, why not? That r is huge!

**Alex Tutor:** A big r only tells you two things move together. It never tells you which one, if either, is causing the other.

## Four ways a correlation can fool you

**Alex Tutor:** Direct causation is one option: more spend really does buy more orders. But reverse causation is possible too — happy customers write more reviews; reviews don't make them happy.

**Alex Tutor:** Then there's a confounder: something else drives both. During flash sales the site slows down AND orders spike — the sale caused both, not one the other.

![An orange sale tag sends arrows to a slow-loading laptop and to a pile of order boxes; there is no arrow between the laptop and the boxes.](https://productovi.com/courses/statistics-for-pm-and-marketers/inline/correlation-illustration-4.webp)

*A confounder: the sale slows the site and boosts orders, so the two move together without one causing the other.*

**Sofia:** So how do I tell which one it is, just from the chart?

**Alex Tutor:** Usually you can't, from correlation alone. That's exactly why controlled experiments exist — you'll run one in module 3.

> **Confounding variable**
>
> A third variable that affects both the supposed cause and the supposed effect, creating a correlation that isn't really about either one.

> **Exercise:** Match each scenario to the explanation that fits it best.

## Pearson vs Spearman correlation

**Alex Tutor:** Good instincts. Before the checklist, one more tool. The r you computed is Pearson's correlation coefficient, and it has a weak spot: one wild week can drag it far off.

**Sofia:** How wild does a week have to be?

**Alex Tutor:** Say a food blogger mentions CatChow in week 5, and the attribution tool credits ads with 120 orders instead of 36. Pearson's r drops from 0.95 to about 0.26. One odd week, and a strong relationship almost disappears.

**Alex Tutor:** Spearman's rank correlation is the fix. Replace each value with its rank, 1 for the smallest and 10 for the largest, then compute Pearson's r on the ranks. A huge week simply becomes rank 10, however huge it was.

**Alex Tutor:** With the blogger week, Spearman stays at 0.78. On the real ten weeks both coefficients give 0.95, because there's no outlier. Reach for Spearman when a metric is skewed (like order value), has outliers, or rises steadily but not in a straight line.

**Alex Tutor:** So which number would you put in the report for the blogger version of the data?

> **Exercise:** CatChow compares ten weeks of ad spend with orders from ads. In one week a blogger mentioned the shop, and ads were credited with 120 orders instead of about 36. Pearson gives r ≈ 0.26 and Spearman gives ρ ≈ 0.78. Which number better describes how spend and orders usually move together?

**Sofia:** So: Pearson for clean, straight-line data, Spearman when it's messy. Anything else before I trust a correlation?

**Alex Tutor:** Just a checklist: does a plausible confounder exist? Could the arrow point the other way? Is the sample big enough to rule out coincidence? Would an experiment settle it?

**Sofia:** Okay, four questions before I trust any correlation. Got it.

> **Exercise:** Before trusting a strong correlation between ad spend and orders, which checks are worth doing? Select all that apply.

## Before you tell the CFO

**Alex Tutor:** Solid list. Now put it into words — imagine explaining this to someone who wasn't in this chat.

**Sofia:** Do I need to write an essay?

**Alex Tutor:** No — a few honest sentences beat a long one that dodges the point.

**Alex Tutor:** Here's your first task.

> **Exercise:** A colleague says: "Orders and ad spend have r = 0.95, so more ad spend causes more orders. Let's triple the budget." What's wrong with this reasoning, and what would you check first? Answer in 2-4 sentences.

**Alex Tutor:** Good instinct — not extrapolating is exactly the right worry. Now for the real recommendation.

**Sofia:** No pressure, then.

**Alex Tutor:** You've got everything you need: the chart, the r, and four ways correlation can mislead. Use them.

**Alex Tutor:** Here's the scenario.

> **Exercise:** Write your recommendation to the CatChow leadership team about the ad-spend and orders relationship.

**Alex Tutor:** Solid work today. The correlation coefficient tells us how strongly two things move together. Next time: regression, which tells us exactly how many orders each extra dollar buys.

- Previous lesson: [Repeated measures ANOVA](https://productovi.com/courses/statistics-for-pm-and-marketers/repeated-measures.md)
- Next lesson: [Simple linear regression](https://productovi.com/courses/statistics-for-pm-and-marketers/linear-regression.md)

---
Productovi Learning. Free, no sign-up needed to read.
