Title: Chapter 4 — Relationships Between Two Variables
Course: Introduction to Statistics (18-Week Generic Edition)

Course: Introduction to Statistics (18-week generic edition) The module's primary reading · ~30–40 minutes · Objective 3 · Read this before (or alongside) the week's lecture — everything else in the module builds on it.

Why you already care about this

You already believe in statistical relationships — you just haven't measured one yet. If someone lined up everybody you know by height, you'd bet (correctly) that shoe sizes would roughly climb along the line. If a friend shopping for a used car says "it's older, so it should cost less," they're leaning on a relationship between two variables. When you notice that your worst nights of sleep follow your longest evenings of scrolling, you're doing two-variable statistics in your head — and probably sneaking in a causal claim while you're at it.

Weeks 1 through 3 taught you to handle one variable at a time: where it comes from, what its distribution looks like, where its center sits, and how much it spreads. But almost every interesting question in the real world is about two variables at once: does one move with the other? By the end of this chapter you will be able to: read and describe a scatterplot (direction, form, strength, outliers); interpret the correlation coefficient r and recite its rules; build marginal and conditional distributions from a two-way table and use them to spot an association; and — the crown jewel — explain exactly why a measured association, however strong, is not proof that one variable causes the other.

Here is the week in one line: this chapter teaches you to measure the handshake — and to stop yourself before you call it a push.

Where we are

Week 1 taught you where data come from and planted the slogan correlation is a handshake, not a push. Week 2 turned one column of numbers into pictures; Week 3 compressed one column into numbers (center, spread) — and warned you that some measures, like the mean, are not resistant to outliers. This week, both of those toolkits go two-dimensional: pictures for pairs (the scatterplot), a number for pairs (r), and a table for category-pairs (the two-way table). Everything you learned about outliers and resistance comes along for the ride.

1. The scatterplot: two columns become one picture

Suppose each individual in your dataset carries two quantitative measurements — every day has a temperature and a sales figure; every penguin has a flipper length and a body mass. The graph for that situation is the scatterplot: one dot per individual, placed across for one variable and up for the other. A scatterplot is a room full of individuals, each holding its own pair of numbers.

Before plotting, assign the two roles:

- The explanatory variable is the one we think explains or predicts — it takes the x-axis (the horizontal axis).
- The response variable is the outcome we care about — it takes the y-axis (the vertical axis).

The test that settles the roles: which variable would you use to predict the other? You'd use the forecast temperature to predict sales, so temperature is explanatory. Memory hook: x explains, y responds. (Sometimes neither direction is obvious — flipper length and bill length, say. Then either axis works, but say so out loud.)

Once the dots are down, you read the plot with four questions, always in this order:

1. Direction — uphill or downhill? If the variables rise together, the association is positive; if one falls as the other rises, it's negative.
2. Form — is the pattern roughly a straight line? A curve? Separate clusters?
3. Strength — do the dots hug the pattern tightly, or spray loosely around it?
4. Outliers — is any dot far from the crowd, or far off the pattern?

Memory hook: Direction, Form, Strength — then check for Stragglers.

Worked example. A hot-cocoa stand records, for five days, the day's high temperature (°F) and the cups of cocoa sold:

The table below lists the five (temperature, cups) pairs.

Day's high (°F) | 40 | 50 | 60 | 70 | 80
Cups sold | 42 | 40 | 26 | 28 | 14

Temperature is the explanatory variable (you'd use the forecast to predict sales), so it takes x; cups sold is the response, on y. Plot the five dots — (40, 42), (50, 40), (60, 26), (70, 28), (80, 14) — and read them in order. Direction: downhill — warmer days go with fewer cups, a negative association. Form: roughly a straight line (notice the little wiggle at 60 versus 70 — real data wobbles; a pattern doesn't need to be perfect to be a pattern). Strength: the dots stay close to a line — strong. Outliers: none.

Now say it as a sentence, because a scatterplot description is a sentence, not a number: "There is a strong, negative, roughly linear relationship between temperature and cocoa sales — colder days go with more cups sold."

Misconception check. "The dots don't fall exactly on a line, so there's no real relationship." Real data never falls exactly on a line. The question is never "is it perfect?" but "is there a pattern, and how tight is it?" Perfection is reserved for the next section's ±1 — which you will more or less never meet.

In practice (your tools). In Google Sheets or Excel, put the explanatory variable in one column and the response beside it, select both, and use Insert ▸ Chart (choose Scatter chart if it guesses wrong; in Excel, Insert ▸ Scatter (X, Y)). A Desmos-class graphing tool draws the same picture from a typed-in table. You'll do exactly this — on real penguins — in Data Lab 4.

2. Correlation r: the whole cloud in one number

"Strong" and "fairly tight" are eyeball words, and two honest people can eyeball differently. So statisticians compress the direction and strength of a straight-line relationship into a single number: the correlation coefficient r.

Here is everything r tells you, in two moves:

- The sign gives the direction. Positive r → uphill; negative r → downhill.
- The size gives the strength. r always lands between −1 and +1. The closer to ±1, the tighter the dots hug a straight line; the closer to 0, the weaker the linear pattern.

Memory hook: sign = direction, size = strength.

The course's rough strength ladder (a guide, not a law — always read it alongside the plot):

- |r| = 1 → a perfect straight line, every dot exactly on it (essentially mythical in real data)
- |r| ≈ 0.7 to 0.99 → strong
- |r| ≈ 0.3 to 0.7 → moderate
- |r| below ≈ 0.3 → weak to none

Worked example (the cocoa stand, continued). We do not compute r by hand in this course — technology does it, and your job is the interpretation. For the five cocoa days, =CORREL(temperature range, cups range) returns r = −0.94. Check it against your eyes: the sign is negative, matching the downhill direction you saw; the size, 0.94, sits high on the ladder, matching the tight cloud you saw. In words — always in words: "r = −0.94: a strong negative linear relationship between temperature and cocoa sales."

That habit — r must agree with your eyes — is worth more than any formula. If the plot looks like a loose spray and the software reports r = −0.94, don't celebrate; go find your data-entry error.

The rules of r — learn all five; three of them are favorite trap material:

1. r applies only to two quantitative variables. There is no r between species and island. And coding categories as numbers (1 = first-time, 2 = returning) doesn't help — numeric labels are still labels, exactly as Week 1's NOIR lesson warned.
2. r has no units. Not degrees, not cups, not dollars. Converting °F to °C, or cups to liters, changes r not at all.
3. Swapping x and y leaves r unchanged. The correlation of temperature with sales equals the correlation of sales with temperature.
4. r measures straight-line association only. A strong curved relationship — an arch that rises and then falls — can produce an r near 0, because the uphill half and the downhill half cancel. r isn't lying; it's answering a narrower question than you asked.
5. r is not resistant. One outlier can inflate a weak correlation or wreck a strong one — the same resistance story you met with the mean in Week 3.

Misconception check. Three misreads to retire today. "r ≈ 0 means no relationship" — no: it means no straight-line relationship; look at the plot before concluding anything. "r = −0.9 is weaker than r = +0.5 because it's negative" — no: strength is distance from 0, and the minus sign only says "downhill"; −0.9 is far stronger than +0.5. "r = −0.94 means sales drop by 94%" — no: r is not a percent, a slope, or a rate of anything; it measures how tightly dots follow a line, and nothing else.

In practice (your tools). =CORREL(A2:A6, B2:B6) in Sheets or Excel, with your two ranges. Worth thirty seconds of your life: also run =CORREL(B2:B6, A2:A6) and watch the same number appear — rule 3, demonstrated rather than memorized.

3. Two-way tables: when both variables are categories

Scatterplots and r need numbers on both axes. But plenty of variable pairs are categorical on both sides: species and island, ticket type and yes/no, first-time versus returning. You can't put "Chinstrap" on an axis — so instead of plotting, you count.

A two-way table counts individuals by two categorical variables at once. One variable's categories label the rows; the other's label the columns. Each cell holds a joint count — the number of individuals in that row category and that column category. The row totals and column totals live in the margins, and each set of margins adds back to the grand total. (Always run that check; it catches half of all table errors before they start.)

Two kinds of percentage live in this table, and telling them apart is the entire skill:

- A marginal distribution answers: "forgetting the other variable entirely, how does this one split up?" You read it from a margin, as percents of the grand total.
- A conditional distribution answers: "among ONE group only, how does the other variable split up?" The denominator is that group's total — that row's (or column's) margin, not the grand total.

Memory hook: marginal = from the margins, out of everyone; conditional = inside one group, out of that group. The denominator tells you which one you're holding.

Worked example. A city aquarium surveys 200 exiting visitors: was this a first visit or a return visit, and did they buy a membership on the way out?

The two-way table below shows the counts, with margins.

 | Bought membership | No membership | Total
First-time visitor | 30 | 90 | 120
Returning visitor | 40 | 40 | 80
Total | 70 | 130 | 200

Check the margins first: 120 + 80 = 200 ✓ and 70 + 130 = 200 ✓. Now the two kinds of percent:

- Marginal distribution of membership: 70 ÷ 200 = 0.35 → 35% of all visitors bought; 130 ÷ 200 = 65% didn't.
- Conditional distribution among first-timers: 30 ÷ 120 = 0.25 → 25% bought. The denominator is 120 — first-timers only.
- Conditional distribution among returners: 40 ÷ 80 = 0.50 → 50% bought. Denominator 80.

And the payoff: 25% versus 50%. The conditional distributions differ across the groups, so visit type and membership purchase are associated — returning visitors buy memberships at twice the first-timer rate. If the conditionals had come out (about) equal, we'd conclude there's no association: knowing the visit type would tell you nothing about membership. Comparing conditional distributions IS the association check for categorical variables — file that away, because it returns in Week 16 wearing a formal significance test.

Misconception check. The classic table error is a wrong denominator. Asked "what percent of returning visitors bought a membership?", it is tempting to answer 40 ÷ 200 = 20% (that's the joint percent — returners-who-bought out of everyone) or 40 ÷ 70 ≈ 57% (that answers a different question: among buyers, what fraction were returners?). The fix is mechanical: find the "among ___" group first; that group's total is your denominator. Among returners → out of 80 → 50%.

In practice (your tools). With two categorical columns in a spreadsheet, select the data and use Insert ▸ Pivot table: set Rows to one variable, Columns to the other, and Values to COUNTA of either column — the margins appear for free. The fallback that works everywhere is =COUNTIFS(range1, "category1", range2, "category2"), one cell at a time. Data Lab 4 has you build exactly this table for penguin species by island.

4. Association is not causation: lurking variables

You can now measure a relationship two ways — r for number-pairs, a gap between conditionals for category-pairs. Here is the discipline that keeps those measurements honest: an observed association, however strong and however carefully computed, can happen for three different reasons:

1. x really does drive y.
2. y really drives x — the arrow can point backward.
3. A third variable drives both — and the two things you measured are just along for the ride.

That third variable has a name. A lurking variable is a variable you didn't plot or tabulate that influences both of the ones you did. It can manufacture an association out of nothing — or hide a real one. And when effects tangle so badly you can't tell which variable is doing the work, you have confounding, the same villain Week 1 introduced.

Worked example (a manufactured association). A town's records show that in stretches of days with more lemonade-stand permits, there are also more sunburn cases — a genuinely strong positive association. Does lemonade cause sunburn? Of course not. Hot, sunny weather is lurking behind both: it sends kids to the permit office and people to the beach. Plot permits against sunburns and you will see a real uphill cloud. The cloud is real; the arrow between them is not.

Worked example (a backward arrow). People carrying umbrellas are far more likely to experience rain that day. The association is real and strong — and umbrellas do not cause rain. The forecast of rain causes the umbrellas. When you meet an association, the direction of any arrow is a separate claim needing separate evidence; the data alone rarely settles it.

So what's the move? Whenever you see an association, ask out loud: "What ELSE could drive both?" If you can name a plausible lurking variable — and you usually can — the causal claim is not earned. The only design that earns it is the one from Week 1: a randomized experiment, where random assignment breaks every lurking variable's grip at once.

Memory hook, upgraded from Week 1: correlation is a handshake, not a push — and before you believe a push, hunt the third hand.

Misconception check. "We computed r carefully / the conditionals differ by 25 points, so the cause is established." Careful arithmetic measures the association perfectly — and says nothing at all about the arrow. Precision about the handshake is not evidence of a push. (Who returns to an aquarium? People who already love aquariums. The membership gap may say more about who they were walking in than about anything the visit did.)

Key terms

- Explanatory variable — the variable we think explains or predicts; plotted on the x-axis.
- Response variable — the outcome we hope to explain or predict; plotted on the y-axis.
- Scatterplot — a graph with one dot per individual, showing that individual's values on two quantitative variables.
- Direction — positive (variables rise together) or negative (one rises as the other falls).
- Form — the pattern's shape: roughly linear, curved, or clustered.
- Strength — how tightly the dots follow the pattern.
- Outlier — a point far from the crowd or far off the pattern.
- Correlation coefficient r — a unitless number between −1 and +1 measuring the direction (sign) and strength (size) of a straight-line association between two quantitative variables.
- Two-way table — a table counting individuals by two categorical variables at once; cells hold joint counts, margins hold totals.
- Marginal distribution — the distribution of one variable alone, as percents of the grand total (read from a margin).
- Conditional distribution — the distribution of one variable within a single category of the other, as percents of that group's total.
- Association (categorical) — present when the conditional distributions differ across groups.
- Lurking variable — a third variable, not among the two displayed, that influences both and can create or mask an association.
- Confounding variable — a variable whose effects on the response are tangled with the explanatory variable's, so the two can't be separated (from Week 1).

Summary

- Two quantitative variables → a scatterplot: x explains, y responds; read it with Direction, Form, Strength — then Stragglers, and report a sentence, not just a number.
- r compresses direction and strength of the linear pattern into one number in [−1, +1]: sign = direction, size = strength. It has no units, ignores axis-swapping and unit changes, sees straight lines only, and is not resistant to outliers.
- Two categorical variables → a two-way table: marginal distributions read from the margins (out of everyone); conditional distributions live inside one group (out of that group's total). Different conditionals = association.
- The denominator is the whole game in table questions: find the "among ___" group first.
- Association ≠ causation: the arrow could run either way, or a lurking variable could drive both. Hunt the third hand; only a randomized experiment earns a causal claim.

Check your understanding

Work these before looking at the answers — they're ungraded, and the answers (with reasoning) are at the bottom of the page.

1. A dog-walking service records, for each outing, the number of dogs walked and the total minutes the outing took. To predict outing length from group size: name the explanatory and response variables, say which axis each takes, and state the direction you'd expect the association to run — with a one-line reason.
2. A candle-maker burn-tests one line of candles, recording hours burned and remaining height (cm); technology reports r = −0.95. (a) Describe the relationship in one sentence (direction and strength, in context). (b) The maker converts every height from centimeters to inches and reruns the calculation — what happens to r, and why? (c) Does r = −0.95 mean each hour removes 95% of the candle? Explain.
3. A farmers-market stall logs 160 purchases: 100 paid by card (60 bought produce, 40 bought crafts) and 60 paid cash (48 bought produce, 12 bought crafts). (a) Give the marginal distribution of item type. (b) Give the conditional percent buying produce among card payers and among cash payers. (c) Are payment method and item type associated? Point to the numbers that decide it.
4. A furniture blog reports: "People who own standing desks report fewer back complaints — buy a standing desk and fix your back." Using this week's three-reasons framework, explain what's wrong with the advice, name a plausible lurking variable, and say what kind of study could support the claim.

Answers (worked reasoning — read after attempting)

1. Explanatory: number of dogs (you'd use group size to predict time), so it takes the x-axis; response: minutes, on the y-axis. Expected direction: positive — more dogs generally means more leash-untangling, more stops, more minutes, so the dots should climb from left to right.
2. (a) "There is a strong negative linear relationship between hours burned and remaining height: the longer a candle has burned, the shorter it stands." The sign gives the downhill direction; 0.95 sits at the top of the strength ladder. (b) Nothing happens — r is still −0.95. r has no units, so rescaling a variable (cm → inches) leaves it unchanged; that's rule 2. (c) No. r is not a percent or a rate — it doesn't say how much height an hour removes (that's a slope-style question, which arrives in Week 17). It only says the dots follow a downhill line very tightly.
3. (a) Marginal distribution of item type: produce 60 + 48 = 108 of 160 → 67.5%; crafts 40 + 12 = 52 of 160 → 32.5%. (Denominator: the grand total, 160.) (b) Among card payers: 60 ÷ 100 = 60% produce. Among cash payers: 48 ÷ 60 = 80% produce. (Denominators: each group's own total.) (c) Yes, associated: 60% versus 80% — the conditional distributions differ across payment groups, so knowing the payment method changes your best guess about the purchase. (Equal conditionals would have meant no association.)
4. The blog observed an association and sold it as a cause. Run the three reasons: standing desks might genuinely help (x → y); but people whose backs already feel fine may be the ones who choose standing desks (y → x, a backward arrow); or a lurking variable — say, being generally health-conscious (more exercise, better ergonomics awareness, more disposable income for office gear) — could drive both desk-buying and fewer complaints. Since nobody was assigned a desk, the data can't pick among the three. What could: a randomized experiment — randomly assign standing desks to some workers and not others, then compare back complaints.

Next up in this module: the slide deck if you want the lecture's visual walk-through, then the Readings & Resources page for optional deeper dives — and when you're ready to practice, Lecture Tutorial 4 turns your chatbot into your personal Week 4 tutor.