Statistics › Section L · Linear regression and correlation › Topic L.2

Scatterplots and the correlation coefficient

Does studying raise scores? Does price track quality? Two quantitative variables meet in a scatterplot, and the correlation coefficient r compresses their relationship into one number - direction, strength, and one strict limit: straightness only.

Two variables meet

Questions about pairs of quantitative variables - hours studied and exam scores, price and rating, height and weight - begin in a scatterplot: one point per individual, the explanatory variable on the x-axis, the response on the y-axis. The plot is read in three parts: direction (positive or negative - do the points climb or fall?), form (linear or curved?), and strength (how tightly do the points hug their pattern?), plus any outliers standing apart from the cloud.

The correlation coefficient r

The correlation \(r\) measures the strength and direction of a LINEAR relationship:

r = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2 \sum (y_i - \bar{y})^2}}

Each point contributes the product of its deviations from the two means: points in the same quadrant of the scatter (both above or both below) contribute positively, opposite quadrants negatively. The normalisation caps \(r\) between \(-1\) and \(1\), with the sign giving direction and the magnitude the tightness around a straight line.

Reading r's magnitude

Guidelines, not laws: \(|r|\) above about 0.8 reads as strong, 0.5 to 0.8 moderate, below 0.5 weak, and under about 0.3 very weak. \(r = 1\) or \(-1\): every point on a perfect line. \(r = 0\): no linear pattern - but NOT no relationship: a perfect U-shaped curve, symmetric about the middle \(x\), has \(r = 0\), because its climbs and falls cancel. The habit that protects against most misreadings: plot the data first, then compute \(r\), because \(r\) only grades the pattern the plot shows.

r is unitless and scale-proof

Correlation has no units - deviations cancel their units in the ratio - and it survives any change of units of the form \(y' = cy + d\) with \(c > 0\), applied to either variable: measuring height in centimetres or inches, temperature in Celsius or Fahrenheit, prices in dollars or cents leaves \(r\) exactly unchanged, because adding \(d\) leaves deviations alone and multiplying by \(c\) scales every deviation by the same factor, which cancels. This scale-independence is what makes \(r\) comparable across studies: a correlation of 0.7 between study time and scores means the same tightness whatever the units. A NEGATIVE multiplier keeps the size of \(r\) but flips its sign: reversing one axis turns a rising pattern into a falling one.

Worked example: computing r by hand

Five students' study hours \(x\): 1, 2, 3, 4, 5; scores \(y\): 2, 4, 5, 4, 5. 1. Means: \(\bar{x} = 3\), \(\bar{y} = 4\). 2. Deviation products: \((-2)(-2) + (-1)(0) + (0)(1) + (1)(0) + (2)(1) = 4 + 0 + 0 + 0 + 2 = 6\). 3. Squared deviations: \(\sum(x-\bar{x})^2 = 10\), \(\sum(y-\bar{y})^2 = 6\). 4. \(r = \frac{6}{\sqrt{10 \times 6}} = \frac{6}{\sqrt{60}} \approx 0.775\). 5. Check: the plot climbs (positive products dominate) and the points scatter loosely around a rising line - a positive, moderate (close to strong) match for 0.775.

Worked example: scale-proof in action

Convert the five scores to a rescaled scale - \(y' = 10y + 50\), as if converting to a different test's points system - and recompute. 1. New scores: 70, 90, 100, 90, 100. 2. Every deviation \(y' - \bar{y'}\) is exactly 10 times the old deviation, so the product sum is \(10 \times 6 = 60\) and the squared sum is \(100 \times 6 = 600\). 3. \(r = \frac{60}{\sqrt{10 \times 600}} = \frac{60}{\sqrt{6000}} \approx 0.775\) - identical. Check: the rescaling's factors cancel in the ratio, which is the proof in one small example that \(r\) belongs to the relationship, not the units.

Outliers and influential points

Because \(r\) is built from products of deviations, unusual points can dominate it. A point far from the others in the \(x\)-direction is often influential: it can swing \(r\) dramatically by itself, because its large \(x\)-deviation multiplies whatever \(y\)-deviation it carries. The discipline: compute \(r\) with and without any suspicious point, and report both if the verdict changes - a correlation that one observation makes or breaks is a statement about that observation, not the relationship.

Correlation is not causation

Ice cream sales and drowning deaths rise together every summer - \(r\) is strongly positive - and ice cream drowns no one: hot weather drives both. Lurking variables create correlation without causation, and only a well-designed randomised experiment convincingly separates them. Cities with more firefighters see more fire damage (city size lurks); students with more tutors may have lower scores (struggling students hire tutors). A strong \(r\) is the beginning of a story, never the end: it says the variables travel together, and the design says why.

Simpson's paradox: aggregation can flip a pattern

Two clinics compare recovery rates for treatment A against B. Clinic 1 (mostly mild cases): A recovers 70 of 100 (70%), B recovers 10 of 12 (83%). Clinic 2 (mostly severe): A recovers 2 of 12 (17%), B recovers 20 of 100 (20%). Within BOTH clinics, B does better. Pooled: A recovers 72 of 112 (64%), B 30 of 112 (27%) - A looks vastly better. The reversal is real arithmetic: A's cases were mostly mild, B's mostly severe, and the severity mix - a lurking variable in the aggregation - swamps the within-clinic comparison. Simpson's paradox is the categorical cousin of a lurking variable: before trusting any pooled comparison, check whether the mix itself differs.

Common mistakes to avoid

First, computing \(r\) for categorical data - correlation needs two quantitative variables. Second, reading \(r = 0\) as "no relationship" when the plot curves. Third, confusing r's magnitude with causation. Fourth, letting an influential point pass unexamined. Fifth, comparing correlations across different-shaped data as if \(r\) graded more than straightness. Sixth, trusting a pooled rate without checking the mix - Simpson's paradox punishes aggregation done blind.

Key takeaways

Scatterplots are read by direction, form, strength and outliers; the correlation \(r\) grades the linear part: \(-1\) to \(1\), sign for direction, magnitude for tightness (above 0.8 strong, 0.5 to 0.8 moderate, below 0.5 weak as rough guides). \(r\) is unitless and rescaling-proof - the study-time example gives 0.775 on any scale - but measures straightness only, so plot first. Influential points can swing \(r\); compute with and without. Correlation is not causation: lurking variables travel with both. And pooled comparisons can reverse their groups' pattern - Simpson's clinic reversal (B better in both, A better pooled) is the categorical warning. Two quantitative variables travel together; the design says why.

Flashcards

Flashcard

Scatterplot

One point per individual, x explanatory, y response

Direction, form, strength, outliers.

Test your understanding

Question 1 of 5

A scatterplot shows a perfect U-shaped curve, symmetric about the middle x, with y falling then rising as x grows. The correlation r is:

Question 2 of 5

For x: 1-5 and y: 2, 4, 5, 4, 5, the deviation-product sum is 6 with Σ(x−x̄)² = 10 and Σ(y−ȳ)² = 6. r is about:

Question 3 of 5

Rescaling y to y′ = 10y + 50 changes r to:

Question 4 of 5

Ice cream sales and drowning deaths are strongly positively correlated. The best explanation:

Question 5 of 5

In both clinics treatment B beats A, but pooled A beats B. This is:

← Previous topicNext topic →