Find a course

Module 4: Comparing and Finding RelationshipsLesson 9 of 1213 min

Correlation and Simple Regression

Read scatter plots and correlation coefficients, avoid jumping from correlation to causation, and use a regression line to make careful predictions.

Step 1 of 10Learn

Do bigger stores sell more?

A retail chain has 40 stores of different sizes. Plot each store as a dot, with floor area on the horizontal axis and annual sales on the vertical axis, and you have a scatter plot, the basic tool for seeing how two numerical variables relate.

When you look at a scatter plot, describe three things:

  • Direction: do the dots trend upward (positive relationship: bigger stores, more sales) or downward (negative: more price, fewer units sold)?
  • Form: do they follow roughly a straight line (linear), a curve, or no clear pattern?
  • Strength: are the dots tightly clustered around the pattern, or widely scattered?

Also look for outliers and clusters. One huge flagship store far from the others can dominate the pattern. Two separate clouds of dots might reveal two kinds of stores, say, mall and street locations, that should be analyzed separately.

The correlation coefficient, written r, summarizes the strength and direction of a linear relationship in one number from −1 to +1:

  • r = +1: all points lie exactly on an upward line.
  • r = −1: all points lie exactly on a downward line.
  • r = 0: no linear relationship.

In practice, |r| around 0.1 is weak, around 0.3–0.5 moderate, and above about 0.7 strong, though what counts as strong depends on the field. In spreadsheets, CORREL calculates r.

Two warnings. First, r measures only linear relationships: a perfect U-shaped curve can have r near 0. Second, r is sensitive to outliers. Always look at the scatter plot, not just the number.

Step 2 of 10Practice · Chart

Store size vs. annual sales

Tap the store that does not fit the pattern.

Tap the point that answers the question, then press Check.

Store size vs. annual salesScatter plot with 10 points: Store 1: Floor area (thousand sq ft) 1.2, Sales ($M) 0.9; Store 2: Floor area (thousand sq ft) 1.8, Sales ($M) 1.3; Store 3: Floor area (thousand sq ft) 2.1, Sales ($M) 1.2; Store 4: Floor area (thousand sq ft) 2.5, Sales ($M) 1.7; Store 5: Floor area (thousand sq ft) 3, Sales ($M) 2; Store 6: Floor area (thousand sq ft) 3.4, Sales ($M) 0.8; Store 7: Floor area (thousand sq ft) 4, Sales ($M) 2.6; Store 8: Floor area (thousand sq ft) 4.5, Sales ($M) 2.7; Store 9: Floor area (thousand sq ft) 5.2, Sales ($M) 3.3; Store 10: Floor area (thousand sq ft) 5.8, Sales ($M) 3.4.01234123456Sales ($M)Floor area (thousand sq ft)
Illustrative data: a strong positive, roughly linear relationship.
Store size vs. annual sales
PointFloor area (thousand sq ft)Sales ($M)
Store 11.20.9
Store 21.81.3
Store 32.11.2
Store 42.51.7
Store 532
Store 63.40.8
Store 742.6
Store 84.52.7
Store 95.23.3
Store 105.83.4

Step 3 of 10Practice · Match the pairs

Match each correlation coefficient to the best description of its scatter plot.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. r = 0.95
  2. r = 0.40
  3. r = 0.02
  4. r = −0.85

Step 4 of 10Learn

Correlation is not causation, again

In data analysis, correlations are everywhere and easy to misread. If customers who use the mobile app spend 40% more than those who don't, should the company push everyone to the app?

Maybe not. The possible explanations:

  • The app causes more spending (convenient, has reminders).
  • Reverse causation: customers who already spend a lot are the ones who bother to download the app.
  • Confounding: a third variable drives both. Loyal, long-time customers are more likely to use the app and to spend more.
  • Chance: with enough variables, some pairs will correlate by pure coincidence. Analysts who test hundreds of metrics will find "significant" correlations that mean nothing.

Famous spurious correlations illustrate the last point: across some years, the number of films a particular actor appeared in correlated strongly with the number of people who drowned in swimming pools. Neither causes the other; both just happened to move together.

To get closer to causation, you need either a controlled experiment (randomly assign some customers to get an app promotion and compare them with a control group, which is the topic of the next lesson) or careful analysis that compares like with like, for example comparing app users and non-users with the same tenure and past spending.

In reports, use careful language for correlational findings: "associated with" or "linked to", not "drives" or "causes", unless you have experimental evidence.

Step 5 of 10Practice · Diagram

App users spend 40% more. Why?

Which explanation says a third variable, loyalty, drives both?

Tap the shape that answers the question, then press Check.

App users spend 40% more. Why?Hierarchy diagram: App users spend more, App causes spending, Reverse causation, Confounding, Chance.App users spendmoreApp causesspendingReversecausationConfoundingChance
App users spend more
App causes spending

Convenience and reminders.

Reverse causation

Big spenders are the ones who download the app.

Confounding

Loyalty drives both app use and spending.

Chance

With enough variables, some correlate by coincidence.

Step 6 of 10Practice · What would you do?

What would you do?

An analysis shows that employees who attend more optional training sessions get higher performance ratings (r = 0.45). An executive proposes making training mandatory for everyone to raise performance. What is the best response?

Step 7 of 10Learn

Fitting a line: simple linear regression

Correlation tells you how strongly two variables move together. Simple linear regression goes a step further and fits the best straight line through the scatter plot, so you can describe the relationship and make predictions:

predicted y = a + b × x

  • b is the slope: how much y changes, on average, for each one-unit increase in x.
  • a is the intercept: the predicted y when x = 0 (which may or may not be meaningful).

"Best" line usually means the least squares line: the one that makes the squared vertical distances from the points to the line as small as possible. Spreadsheets compute it with SLOPE and INTERCEPT, or by adding a trendline to a chart.

Example: for the store chain, regression gives predicted annual sales = $200,000 + $150 × floor area (sq ft). The slope means each extra square foot is associated with about $150 more in annual sales. A 3,000 sq ft store would be predicted to sell $200,000 + $150 × 3,000 = $650,000.

R² (R-squared) tells you what share of the variation in y is explained by the line. For simple regression, R² = r². If r = 0.8, then R² = 0.64: floor area explains about 64% of the variation in sales between stores, and the other 36% comes from location, staff, product mix and chance.

Two cautions:

  • Don't extrapolate far beyond your data. If stores range from 1,000 to 6,000 sq ft, predicting sales for a 50,000 sq ft store assumes the line keeps going straight, which it probably doesn't.
  • A regression slope is still correlational. It doesn't prove that adding floor space would raise sales by $150 per square foot.

Step 8 of 10Try the calculator

Regression prediction

Use a fitted line to make a prediction. Enter the intercept, the slope and an x value. The R² output assumes you know the correlation r.

Predicted y
650,000
R² (share of variation explained)
64 %

Step 9 of 10Practice · Work it out

A regression of monthly ad spend (x, in thousands of dollars) on monthly sales (y, in thousands of dollars) gives: predicted sales = 50 + 4 × ad spend. What are the predicted sales, in thousands, for a month with $12,000 of ad spend?

Step 10 of 10Practice · Choose one

Across stores between 1,000 and 6,000 square feet, the correlation between floor area and sales is r = 0.7. Which conclusion is justified?