Even when two variables have a correlation r close to 1 and a tight least-squares line, we need to know whether changing X will actually change Y.
Why Correlation Does Not Mean Causation
The correlation r,r2, and the least-squares regression line only measure whether X and Y move together on a scatterplot. Because the math cannot tell what causes what, an upward slope can happen in four different ways:
Direct cause:X⟶Y(practicing piano ⟶ recital score)Reverse cause:Y⟶X(days with a fever ⟶ fever medicine taken)Common cause:X⟵lurking(confounding)variableZ⟶Y(fire size drives firefighterssent and dollar damage)Plain coincidence:XY(no arrows: two unrelatedtrends match by luck)
In the elementary school dataset, shoe size (X) and reading test score (Y) have r≈1, but buying bigger shoes will not help a child read:
Text solution:
Check how the third variable drives X: As a child's age increases, their feet grow larger.
Age (Z)⟶Shoe Size (X)
Check how the third variable drives Y: As a child's age increases, extra years of schooling raise their reading score.
Age (Z)⟶Reading Test Score (Y)
Connect the two plotted variables: Shoe size and reading score move together only because age drives both at the same time, with no causal arrow between X and Y.
Shoe Size (X)⟵lurking variableAge (Z)⟶Reading Test Score (Y)
1
Testing for Lurking Variables by Slicing
When a lurking variable isn't obvious from common sense, we need a way to test the data itself to see whether a third factor Z is creating the slope between X and Y.
Testing for Lurking Variables by Slicing
To test whether Z is creating a false relationship between X and Y, we slice the data, holding Z fixed so we only compare dots that share the exact same value of Z:
Text solution:
Hold the suspected lurking variable fixed: Restrict the dataset to a single value of Z, such as only 8-year-olds (or only households earning $50,000 per year in the bottled-water study).
single slice of dataZ=8 years old
Check the slope inside that slice: Fit a least-squares line to X and Y using only the dots in that single age group.
Inside the Z=8 slice:slope between Shoe Size (X) and Reading Score (Y)=0
Compare the flat slices with the combined graph: Because the slope disappears inside every single age group (Z=6,Z=8,Z=11), shoe size does not affect reading score; Age (Z) created the overall upward line by shifting older groups up and to the right.
Inside any single age group (6,8, or 11), the least-squares line between shoe size and reading score is flat, while combining those stepped groups creates the steep upward line across the whole school.
Inside every single age group, the trend between shoe size and reading score is completely flat, even though combining all ages creates a steep upward line.
In observational data from the real world, we can only slice by variables we thought to measure, so twenty other unknown lurking variables could still be at work. In an experiment, scientists rule out every lurking variable at once using random assignment:
Coin flip breaks all Z⟶X links(random assignment)⟶{Bottled water groupTap water group
2
Interpolation and Extrapolation
Even when a relationship is real, like age driving height during childhood, and our least-squares line fits the dots closely with a high r2, we need to know how far along the X axis we can trust the line's predictions.
Interpolation and Extrapolation
Using data measured on children from Age 2 to Age 16, the least-squares regression line is:
Predicted Height=30+2.5(Age)
Whether a prediction from this line makes sense depends on where the chosen age sits compared to the ages we actually measured:
Text solution:
Mark the range of measured data: The observed X values run from the youngest child measured to the oldest child measured.
range of dataAge 2≤X≤Age 16
Predict inside the range of data (interpolation): Plugging in Age=10 stays inside the 2-to-16 window, so the prediction is backed by real data on both sides.
interpolation (inside 2 to 16)Predicted Height at Age 10=30+2.5(10)=55 inches (4 ft 7 in)
Predict far outside the range of data (extrapolation): Plugging in Age=50 goes 34 years past the measured data, giving an impossible height because people stop growing after childhood.
extrapolation (outside 2 to 16)Predicted Height at Age 50=30+2.5(50)=155 inches (almost 13 ft)
Between ages 2 and 16, the straight least-squares line follows the measured childhood data closely, but beyond age 16 the extended line keeps climbing past 12 feet while actual human height levels off into adulthood.
A straight line fits how kids grow from age 2 to 16, but extending it into adulthood assumes people never stop growing.
A straight trend can also hit a point where the rules suddenly change. If you heat a pot of 20∘C liquid water across Minutes 1,2, and 3 (30∘C,40∘C,50∘C), extending the line to Minute 20 misses the boiling point where liquid water turns to steam and stays at 100∘C:
Minutes 1 to 3:Predicted Temperature=20+10(Minutes)⟶At Minute 20:fails: liquid water caps at 100∘C20+10(20)=220∘C
Even if a trend didn't bend or hit a boundary, our regression slope is only an estimate from a sample with scatter. Because of that sample scatter, a tiny tilt of the line barely shifts predictions inside the Age 2 to 16 cloud, but swings the line up and down by feet at Age 50 as the uncertainty spreads out wider and wider.
Lines that all fit the sample dots closely stay close together inside the range of the data, but spread out by feet far outside it.
Because uncertainty widens the farther we step from the measured X values, predicting one small step outside the range (like Age 17 after measuring up to Age 16) carries only a small risk, while predicting 34 steps out (Age 50) is a wild guess.
Key concepts
Whenever a scatterplot shows a strong correlation r and a tight least-squares line, run two checks before trusting a conclusion or prediction:
1. The lurking variable check (why do X and Y move together?)
Because r only checks whether X and Y move together, identify which arrow pattern fits the situation: direct cause (X⟶Y, hours of piano practice ⟶ recital score), reverse cause (Y⟶X, days with a fever ⟶ fever medicine taken), common cause / lurking variable (X⟵Z⟶Y,Age driving both Shoe Size and Reading Score), or plain coincidence (no arrows, cheese consumption and bedsheet deaths).
When to slice: To test whether a suspected lurking variable Z is driving the relationship, hold Z fixed in a single slice (only 8-year-olds, or only Household Income=$50,000). If the slope between X and Y flattens out inside the slice, X does not cause Y.
When slicing is not enough: Even if a slope remains after slicing by one variable Z in observational data, unmeasured lurking variables can still be hiding. To block every lurking variable at once, use an experiment with random assignment (flipping a coin to assign X).
2. The extrapolation check (where is the target X compared to the measured data?)
Compare the X value you want to plug into Predicted Y=a+bX against the observed range of data (smallest X≤X≤largest X, such as Age 2 to Age 16 for Predicted Height=30+2.5(Age)):
Interpolation (Age 10, inside Age 2 to 16): Trustworthy, because the prediction is surrounded by measured data on both sides.
Near extrapolation (Age 17, one small step outside Age 2 to 16): Fairly small uncertainty, because the uncertainty has barely widened just past the data.
Far extrapolation (Age 50, far outside Age 2 to 16): Untrustworthy, because outside the measured window a curve can level off (people stop growing after childhood), the rules can change at a boundary (liquid water boils and stays at 100∘C), and a tiny error in the sample slope swings the line wide like the far tip of a long ruler.
3
Practice
1
For each pair of correlated variables below, state which of the four explanations best fits (Direct Cause, Reverse Cause, Common Cause / Lurking Variable, or Plain Coincidence) and give the direction of any causal arrows: (a) Across patients at a clinic, the number of physical therapy visits attended in a year (X) and the initial severity of the patient's joint injury (Y). (b) Across summer days in a beach town, daily sunglass sales (X) and daily sunburn clinic visits (Y). (c) Over a 5-year span, annual U.S. per-capita cheese consumption (X) and annual deaths from getting tangled in bedsheets (Y). (d) Across piano students, hours spent practicing for a recital (X) and recital score (Y).
For each pair, ask: "If I forced X to go up, would Y change? Or did Y happen first, did a third factor Z push both, or is there no real-world connection between them at all?"
(a)Watch out: Don't pick Direct Cause (X⟶Y) just because X is listed first. Attending physical therapy later in the year cannot go back in time to make the initial injury worse. Instead, a more severe initial injury (Y) causes a patient to attend more physical therapy visits (X):
Reverse Cause (Y⟶X)
(b)Buying sunglasses does not cause sunburns, and sunburns do not make people buy sunglasses that same day; instead, hot, sunny weather (Z) drives both higher sunglass sales (X) and more sunburns (Y), with no arrow between X and Y:
Common Cause / Lurking Variable (Z⟶X and Z⟶Y)
(c)Two unrelated national trends happened to move in the same direction over a short 5-year window by pure luck:
Plain Coincidence (no arrows)
(d)Practicing more hours (X) directly builds skill and raises the recital score (Y):
Direct Cause (X⟶Y)
2
A study of 500 employees at a large company finds a strong positive correlation (r=0.84) between the number of computer monitors on an employee's desk (X) and their annual salary (Y). An office supply store claims: "Give yourself a raise: put a third monitor on your desk!" (a) Name a plausible lurking variable Z and explain how it drives both X and Y. (b) When you slice the data to hold job seniority level fixed, looking separately at entry-level staff, mid-level specialists, and senior executives, the least-squares line between monitors and salary inside each slice is completely flat. What does this tell you about the store's claim and why the overall scatterplot sloped upward?
(a) Think of a workplace factor Z that determines both an employee's equipment needs (X) and their pay (Y). (b) Check what a slope of 0 inside each fixed-Z slice tells you when X increases while Z stays the same.
(a)Job seniority or role (Z): Higher-ranking roles require more monitors for complex work (Z⟶X) and also pay higher salaries (Z⟶Y).
(b)Watch out: Don't be fooled by the high overall correlation (r=0.84) into thinking extra monitors still help a little, and don't misread the flat slices as saying seniority doesn't affect pay. Because the slope between monitors and salary drops to 0 when seniority is held fixed, adding a monitor does not raise salary at all; the store's claim is false, and the upward slope in the combined data only happened because we combined separate seniority groups that shift toward more monitors and higher pay as seniority rises.
3
An observational study finds that people who drink expensive bottled water (X) live longer on average (Y) than people who drink tap water. Even after researchers slice the data to hold Household Income fixed at $50,000 per year, bottled-water drinkers in that slice still live slightly longer. (a) Why can we still not be sure from this observational data that bottled water causes longer life? (b) How can scientists design an experiment to rule out all lurking variables at once?
(a) Ask whether two people earning $50,000 who choose different water might still differ in other lifestyle habits Z. (b) How can researchers assign who drinks which water so personal habits cannot influence the choice?
(a)Watch out: Keeping a slope in one slice does not prove causation (X⟶Y). Slicing by Household Income only holds income fixed; in observational data, many other unmeasured lurking variables (such as exercise habits, diet, health habits, or local tap-water quality) were not held fixed and could still be driving both bottled-water purchases and how long people live inside the $50,000 slice.
(b)Watch out: Simply slicing by a few more variables still leaves unknown lurking variables untouched. Instead, scientists use random assignment, such as flipping a coin to decide who drinks bottled water and who drinks tap water, which breaks the link between water type and every lurking variable at once.
4
A veterinarian measures the weight of puppies (Y, in pounds) from Age X=2 weeks to Age X=16 weeks and finds a strong linear relationship (r2=0.96) with least-squares line Predicted Weight=2+1.5(Age in weeks). Find the predicted weight at (a) Age 10 weeks, (b) Age 17 weeks, and (c) Age 150 weeks (about 3 years old). For each, state whether it is interpolation or extrapolation and how trustworthy the prediction is.
Watch out: multiply 1.5×10 before adding 2; adding first to get 3.5×10=35 lb is an order-of-operations mistake.
Compare each target age against the measured range of 2 to 16 weeks: is it inside the data range, a single week past the edge, or years outside the range?
(a)At Age 10 weeks (watch out: multiply 1.5×10 before adding 2; adding first to get 3.5×10=35 lb is an order-of-operations mistake):
Predicted Weight=2+1.5(10)=17 pounds
Because 10 weeks is inside the measured range of 2 to 16 weeks, this is interpolation and is trustworthy (backed by data on both sides).
(b)At Age 17 weeks:
Predicted Weight=2+1.5(17)=27.5 pounds
Watch out: Don't call this completely useless just because it steps outside 2 to 16 weeks. This is extrapolation, but because 17 weeks is only one small step beyond the measured range of 16 weeks, the prediction uncertainty is still fairly small.
(c)At Age 150 weeks:
Predicted Weight=2+1.5(150)=227 pounds
Watch out: Don't trust this prediction just because r2=0.96 is high. This is far extrapolation (134 weeks outside the measured data) and is completely untrustworthy because dogs stop growing and level off in weight long before 150 weeks.
5
In each case below, a regression line with high r2 and small residuals fails when extrapolated. Explain the specific reason why extrapolation breaks down in each situation: (a) A chef heats a pot of liquid water on a stove, records its temperature at Minute 1 (30∘C), Minute 2 (40∘C), and Minute 3 (50∘C), fits the exact line Predicted Temperature=20+10(Minutes), and predicts the liquid water in the pot will reach 220∘C at Minute 20. (b) Two researchers each collect a sample of children aged 2 to 16 and fit a least-squares line predicting height from age. Because of random scatter in their samples, their estimated slopes differ by 0.1 inches per year. At Age 10, their lines predict nearly the same height, so they assume their lines will also agree closely if extended to Age 60.
(a) What happens to liquid water at 100∘C that the 30∘C-to-50∘C data could not show? (b) Picture a long ruler laid through the Age 2 to 16 data cloud: what does a 0.1 in/yr tilt do 50 years further down the ruler?
(a)Watch out: The problem here is not sample scatter, since the line fits Minutes 1 to 3 with zero error. Extrapolation breaks down because the physical rules change at a boundary outside the measured range: at 100∘C, liquid water boils into steam and its temperature stays flat at 100∘C, a boundary the 30∘C-to-50∘C data had no way of showing.
(b)Watch out: Close agreement inside the data range does not stay close far outside it. Small uncertainty in the sample slope grows with distance from the data: like a tiny tilt in a long ruler, a 0.1 in/yr slope difference barely moves the line inside the Age 2 to 16 cloud, but over the 50 years from Age 10 to Age 60 it swings the two predictions apart by 0.1×50=5 inches as the uncertainty spreads out.