Scatterplots and Correlation, STA 270 Section 2.5 – Study Notes
offline

Source: Lecture slides, Section 2.5 (Lock5, 2021)


Big Picture

This section sits in the early descriptive-statistics portion of the course, where you move from summarising one variable at a time to exploring relationships between two quantitative variables. The two core tools here are the scatterplot (a visual) and the correlation coefficient r (a number). You should already be comfortable with means, standard deviations, and z-scores, because the correlation formula is built directly on them. Understanding this material is essential groundwork for linear regression, which comes next.


TL;DR

A scatterplot shows the relationship between two quantitative variables by plotting paired observations as points on a coordinate plane. The correlation coefficient r summarises how tightly those points cluster around a straight line, on a scale from −1 (perfect negative linear) to +1 (perfect positive linear), with 0 meaning no linear trend. Always plot the data first, because r only captures linear relationships and is sensitive to outliers.


Key Terms

Scatterplot

A graph that plots pairs of quantitative values as points on a coordinate axis, showing the relationship between two variables measured on the same cases.

Think of it as: a dot for every observation, with one variable on each axis, so you can see patterns at a glance.

Explanatory variable (X)

The variable you suspect might help explain or predict the other. By convention it goes on the horizontal axis.

In simple terms, this is the "input" or "predictor" variable.

Response variable (Y)

The variable you are trying to predict or explain. By convention it goes on the vertical axis.

In simple terms, this is the "output" or "outcome" variable.

Positive association (direct relationship)

When large values of X tend to occur with large values of Y, and small values of X tend to occur with small values of Y. The scatterplot trends upward from left to right.

Think of it as: both variables move in the same direction.

Negative association (inverse relationship)

When large values of X tend to occur with small values of Y, and vice versa. The scatterplot trends downward from left to right.

Think of it as: when one goes up, the other tends to go down.

Correlation coefficient (r)

A numerical measure that quantifies the direction and strength of the linear relationship between two quantitative variables. Ranges from −1 to +1.

Think of it as: a single number that tells you how closely the cloud of points hugs a straight line, and whether that line slopes up or down.

Sample correlation (r)

The correlation computed from sample data.

Population correlation (ρ, "rho")

The true correlation for the entire population, which r estimates.

Outlier (in a scatterplot)

An individual data point that falls outside the overall pattern of the relationship between the two variables.

In simple terms, a point that does not fit the trend the rest of the data follows.


Scatterplots: What They Are and What to Look For

A scatterplot is the standard way to visualise the relationship between two quantitative variables measured on the same set of cases. Each case becomes a single point, with its X value determining horizontal position and its Y value determining vertical position.

When the objective is prediction, the convention is:

  • Explanatory variable (X) on the horizontal axis

  • Response variable (Y) on the vertical axis

Four things to describe when reading a scatterplot:

  • Type of association – Is the overall pattern linear (roughly a straight line) or nonlinear (curved)?

  • Direction of association – Does the cloud of points trend upward (positive) or downward (negative)?

  • Strength of association – How tightly do the points cluster around the pattern? Described as weak, moderate, or strong.

  • Outliers – Are there individual points that fall well outside the overall pattern?

Always describe all four when you are asked to interpret a scatterplot. That checklist (type, direction, strength, outliers) is what exam questions expect.


Direction and Strength of Association

Direction

Positive (direct) association: Large X values tend to pair with large Y values, and small X values tend to pair with small Y values. The scatterplot slopes upward.

  • Example: height and weight – taller people tend to be heavier.

Negative (inverse) association: Large X values tend to pair with small Y values, and vice versa. The scatterplot slopes downward.

  • Example: cigarettes smoked per day and life expectancy – heavier smokers tend to have shorter lifespans.

No association: Knowing the value of one variable gives you no useful information about the other. The scatterplot looks like a shapeless cloud.

Statistical associations are overall tendencies, not absolute rules. A positive association between height and weight does not mean every tall person is heavy.

Strength

Strength refers to how closely the data points follow a clear form (linear or otherwise).

  • Strong relationship: Points cluster tightly around the pattern. Predictions from one variable to the other are fairly accurate. Example: heating degree-days vs. gas consumption.

  • Weak relationship: Points are widely scattered around the pattern. Predictions are imprecise. Example: state median household income vs. state per capita income.

The spectrum runs: strong negative, moderate negative, weak negative, no association, weak positive, moderate positive, strong positive.


The Correlation Coefficient r – Formula and Computation

The sample correlation r is the average of the products of the standardised values (z-scores) of X and Y:

r = (1 / (n − 1)) × Σ [(xᵢ − x̄) / sₓ] × [(yᵢ − ȳ) / sᵧ]

Step-by-step computation

  1. Collect your n paired observations: (x₁, y₁), (x₂, y₂), …, (xₙ, yₙ).

  1. Compute the sample means x̄ and ȳ.

  1. Compute the sample standard deviations sₓ and sᵧ.

  1. Standardise each observation: convert every xᵢ to (xᵢ − x̄)/sₓ and every yᵢ to (yᵢ − ȳ)/sᵧ.

  1. Multiply each pair of standardised values together.

  1. Sum those products, then divide by (n − 1).

Worked example (Example 2.15 from lecture)

Five observations: (2, 5), (1, 3), (5, 6), (0, 2), (2, 4).

  • x̄ = 10/5 = 2, ȳ = 20/5 = 4

  • sₓ = √(14/4) = √3.5 ≈ 1.87

  • sᵧ = √(10/4) = √2.5 ≈ 1.58

  • Sum of products of z-scores = 3.722

  • r = 3.722 / 4 = 0.93

Interpretation: r = 0.93 is positive and large, indicating a strong positive linear association. X and Y tend to be small together or large together.


Properties of the Sample Correlation r

Seven properties to know cold for exams:

Property 1 – Sign indicates direction

  • r > 0: positive (direct) association.

  • r < 0: negative (inverse) association.

  • This follows from the formula: when both z-scores have the same sign (both above or both below their means), their product is positive, pulling r upward.

Property 2 – Magnitude indicates strength

  • |r| close to 1 means a strong linear relationship.

  • r = +1: all points lie exactly on a straight line with a positive slope.

  • r = −1: all points lie exactly on a straight line with a negative slope.

  • r = 0: no general linear tendency for Y to increase or decrease with X.

Property 3 – Bounded range

  • −1 ≤ r ≤ 1, always. A value outside this range means a calculation error.

Property 4 – Symmetric in X and Y

  • The correlation between X and Y is the same as the correlation between Y and X. Swapping which variable goes on which axis does not change r.

Property 5 – Unitless

  • Changing the units of measurement (e.g. metres to feet, Celsius to Fahrenheit) does not change r. The standardisation step removes all units.

Property 6 – Linear relationships only

  • r measures the strength of linear association only. A dataset with a strong curved relationship can still have r near 0. Always look at the scatterplot.

Property 7 – Not resistant to outliers

  • r is sensitive to outliers. Moving even one point away from the general trend can shift r substantially. In the lecture example, repositioning a single point changed r from −0.91 to −0.75.


Outliers in Scatterplots

An outlier in a scatterplot is a point that does not fit the overall pattern of the relationship. This is different from simply being an extreme value on one variable.

A point that is extreme on X or Y but still falls on the general trend line is not an outlier of the relationship. A point that deviates from the trend, even if it is not extreme on either axis alone, is an outlier of the relationship.

Lecture example: in a plot of blood alcohol content vs. beers/weight, the highest data point sits right where the trend line predicts, so it is not an outlier of the relationship. A different point at a moderate X value but well above the trend line is an outlier.

Why this matters: because r is not resistant (Property 7), a single outlier can substantially inflate or deflate the correlation. Always inspect the scatterplot before trusting a correlation number.


Formulas

Sample mean:

x̄ = (Σ xᵢ) / n

Sample standard deviation:

sₓ = √[ Σ(xᵢ − x̄)² / (n − 1) ]

Sample correlation:

r = [1 / (n − 1)] × Σ [(xᵢ − x̄) / sₓ] × [(yᵢ − ȳ) / sᵧ]

In words: standardise each X value and each Y value into z-scores, multiply the paired z-scores together, sum the products, and divide by (n − 1).


Real-World Applications

Scatterplots and correlation are used constantly in fields where you need to spot or quantify relationships between measured quantities. A public-health researcher might plot daily cigarette consumption against life expectancy across countries to visualise the negative association. An engineer might correlate heating degree-days with household gas consumption to build predictive models for energy demand. In business, analysts plot advertising spend against revenue to judge whether the relationship is strong enough to justify increasing budgets.


Common Misconceptions

  • Students often think r close to 0 means "no relationship." It means no linear relationship. Two variables can have a strong curved association and still produce r ≈ 0.

  • Students often confuse an extreme value on one axis with an outlier of the relationship. A point is only an outlier of the relationship if it deviates from the overall trend, regardless of whether its individual X or Y value looks unusual.

  • Students often assume that a strong correlation means one variable causes the other. Correlation does not imply causation. A lurking third variable, reverse causation, or coincidence can all produce strong correlations.

  • Students often forget that r is sensitive to outliers and quote a correlation without checking the scatterplot. Always plot first, then compute.


Why It Matters / Exam Flags

⚠️ Know all seven properties of r. Exam questions frequently ask "which of the following statements about correlation is true/false" and cycle through these properties.

⚠️ Be able to compute r by hand from a small dataset. The worked example (Example 2.15) with five observations is representative of what you may see on a test.

⚠️ When interpreting r, state both the direction (positive/negative) and the strength (weak/moderate/strong). Saying only "there is a correlation" without specifying direction and strength will cost marks.

⚠️ "Correlation does not imply causation" is a perennial exam favourite. Be prepared to explain why a high r between two variables does not prove that one causes the other.

⚠️ When asked to describe a scatterplot, always address all four features: type, direction, strength, and outliers.


Quick Self-Test

  1. True or false: r = −0.85 indicates a weaker linear relationship than r = 0.60.

False. Strength is determined by |r|, not the sign. |−0.85| = 0.85 > 0.60, so the first relationship is stronger.

  1. True or false: If you switch which variable is on the X-axis and which is on the Y-axis, r changes.

False. r does not distinguish between X and Y (Property 4).

  1. Fill in the blank: r always falls between ______ and ______.

−1 and +1.

  1. True or false: A correlation of r = 0 means there is no relationship at all between X and Y.

False. It means there is no linear relationship. There could still be a strong nonlinear one.

  1. True or false: Converting temperature from Celsius to Fahrenheit will change the correlation between temperature and ice cream sales.

False. r is unitless and unaffected by changes in scale (Property 5).


Practice Q&A

Q: A scatterplot of car weight (lbs) vs. city fuel economy (MPG) shows a downward trend with moderate scatter. Describe the association.

A: The association is negative (heavier cars tend to have lower MPG) and moderate in strength. The form appears roughly linear. The correlation from the lecture data is r = −0.83.

Q: Suppose you compute r = 0.02 for two variables. Can you conclude the variables are unrelated?

A: No. r ≈ 0 only tells you there is no linear relationship. The variables could still have a strong nonlinear (e.g. quadratic) relationship. You would need to inspect the scatterplot.

Q: In the Cars2015 dataset, the correlation between Acc060 and QtrMile is 0.99. What does this tell you?

A: There is a very strong positive linear relationship: cars that take longer to accelerate from 0 to 60 mph also take longer to cover a quarter mile. The points lie very close to a straight line.

Q: A researcher finds r = 0.72 between ice cream sales and drowning deaths. Does ice cream cause drownings?

A: No. Correlation does not imply causation. A lurking variable (hot weather) likely drives both: people buy more ice cream and swim more often when it is hot.

Q: An outlier is removed from a dataset and r drops from 0.85 to 0.40. What property of r does this illustrate?

A: Property 7, that r is not resistant to outliers. A single unusual point can substantially inflate or deflate the correlation.


Connections to Other Topics

This material connects directly to simple linear regression (the next major topic), where you fit a line to the scatterplot and use it for prediction. The correlation r reappears there: r² tells you the proportion of variation in Y explained by the linear relationship with X.

It also builds on the earlier work with z-scores and standard deviation from descriptive statistics. If those concepts are shaky, revisit them, because the correlation formula is literally an average of z-score products.

Later in the course, the distinction between correlation and causation leads into experimental design and confounding variables, where you learn what study designs can support causal claims.


Related Terms / Search Tags

scatterplot, scatter diagram, scatter graph, bivariate data, correlation, correlation coefficient, Pearson correlation, Pearson's r, sample correlation, population correlation, rho, ρ, positive association, negative association, direct relationship, inverse relationship, linear relationship, nonlinear relationship, strength of association, direction of association, outlier, resistant statistic, z-score, standardised value, explanatory variable, response variable, independent variable, dependent variable, predictor, outcome, correlation does not imply causation, lurking variable, confounding variable, STA 270, Lock5