AP STATISTICS • EXPLORING TWO-VARIABLE DATA

Correlation

Quantifying the strength and direction of linear relationships between two quantitative variables.

Historical Context & Motivation

Long before statisticians had a formal measure for the strength of association between two variables, scientists and social researchers recognized that certain quantities tended to move together. Taller parents, for instance, generally had taller children; regions with more rainfall typically produced larger crop yields. These intuitive observations demanded a rigorous, numerical summary—one that could distinguish a weak tendency from a near-perfect linear pattern. The quest to formalize this idea gave rise to the correlation coefficient, one of the most widely used statistics in science.

1888
Galton's Regression Work
Francis Galton published studies on heredity showing that children's heights "regressed" toward the population mean, laying the conceptual groundwork for correlation and regression analysis.
1896
Pearson's r
Karl Pearson formalized the product-moment correlation coefficient r, providing a precise mathematical formula that quantifies linear association on a scale from −1 to +1.
1904
Spearman's Rank Correlation
Charles Spearman introduced a rank-based alternative (ρ) for ordinal data, broadening correlation analysis beyond strictly quantitative, normally distributed variables.
1973
Anscombe's Quartet
Frank Anscombe demonstrated four datasets with nearly identical r values but vastly different scatterplot shapes, powerfully illustrating why visualization must accompany numerical summaries.

The central question that correlation answers is deceptively simple: when one variable increases, does the other tend to increase, decrease, or show no systematic pattern? And if a pattern exists, how tightly do the data points cluster around a straight line? These questions sit at the heart of the AP Statistics curriculum on exploring two-variable data, bridging descriptive scatterplot analysis with the inferential techniques of regression.

Core Principles & Definitions

Before computing any statistic, it is essential to understand the foundational ideas that govern correlation. The Pearson correlation coefficient (denoted r) measures the direction and strength of the linear relationship between two quantitative variables. Several principles govern its proper use and interpretation.

1

Direction

A positive r indicates that as x increases, y tends to increase. A negative r indicates y tends to decrease as x increases.
2

Strength

Values of r near +1 or −1 signal a strong linear pattern; values near 0 indicate a weak linear relationship. The magnitude |r| is what matters for strength.
3

Linearity Only

r measures only linear association. A perfect parabolic relationship can produce r ≈ 0. Always examine the scatterplot first.
4

Unitless & Symmetric

r has no units and does not depend on which variable is called x or y. Swapping the roles of the variables does not change r.
5

Sensitive to Outliers

A single influential point far from the overall trend can dramatically inflate or deflate r, making the scatterplot an indispensable companion to the numerical value.
KEY TAKEAWAY
Think of correlation like tuning a radio dial: r = +1 is a perfectly clear signal where every increase in x produces a proportional increase in y; r = 0 is pure static with no discernible linear pattern; and r = −1 is a perfectly clear inverse signal. Just as a radio only picks up one frequency at a time, r only detects the linear frequency—curved or clustered patterns go unheard.

Visual Explanation — Scatterplots and Correlation

The most effective way to build intuition about correlation is to examine scatterplots that correspond to different values of r. The diagram below displays five representative scatterplot patterns, ranging from strong positive to strong negative linear association, with the no-correlation case in the center. Notice how the "tightness" of the cloud of points around an imaginary straight line increases as |r| approaches 1.

Five scatterplot panels illustrate how the shape of the point cloud corresponds to different correlation values. The bottom number line shows the full spectrum from −1 to +1, with colored dots matching each panel.

In the leftmost panel (r ≈ +0.95), the points fall almost on a rising line, indicating a strong positive association. Moving toward the center panel (r ≈ 0), the cloud becomes spherical and formless—knowing x tells you almost nothing about y. The rightmost panel (r ≈ −0.95) shows a tight descending pattern. The spectrum at the bottom reinforces the key lesson: the sign of r tells direction while the absolute value tells strength.

Mathematical Framework

The formula for the Pearson correlation coefficient converts each observation into a standardized z-score and then averages the products of corresponding z-scores. This elegant construction is why r is unitless—standardization strips away the original measurement scales.

Z-SCORE FORM
r = (1 / (n − 1)) × Σ [ (xᵢ − x̄) / sₓ ] × [ (yᵢ − ȳ) / sᵧ ]
where n = number of data pairs, and ȳ are the sample means, and sₓ and sᵧ are the sample standard deviations of x and y respectively.

This can be equivalently written in raw-score computational form, which is sometimes more convenient for hand calculation.

COMPUTATIONAL FORM
r = [ n Σxᵢyᵢ − (Σxᵢ)(Σyᵢ) ] / √[ n Σxᵢ² − (Σxᵢ)² ] × √[ n Σyᵢ² − (Σyᵢ)² ]
This form avoids computing means and standard deviations first. Both formulas produce the identical value of r.
COEFFICIENT OF DETERMINATION
r² = (fraction of variation in y explained by the linear relationship with x)
Squaring r gives , the proportion of total variability in y that is accounted for by the linear model. For example, r = 0.80 means r² = 0.64, so 64% of the variation in y is explained.
💡 Why z-scores?
When both xᵢ and yᵢ lie above their respective means, both z-scores are positive and their product is positive, contributing a positive term to the sum. When one is above and the other below, the product is negative. Summing these products and dividing by n − 1 yields an average that ranges exactly from −1 to +1—a beautiful consequence of standardization.

Interpreting r — Common Pitfalls and Nuances

Correctly interpreting a correlation value requires more than just reading its sign and magnitude. Several subtleties frequently appear on the AP Statistics exam and in professional practice. The diagram below illustrates four classic pitfalls: situations where the numerical value of r alone can be misleading.

Panel A: a strong curved relationship yields r ≈ 0. Panel B: a single outlier pulls r far from what the main cluster suggests. Panel C: a confounding variable Z drives both x and y, creating a spurious correlation. Panel D: aggregating distinct subgroups can reverse the apparent direction of association.
  • Correlation does not imply causation. A strong r between ice cream sales and drowning rates does not mean ice cream causes drowning—both are driven by warm weather (a lurking variable).
  • r is not resistant. Because the formula uses means and standard deviations, a single extreme point can substantially alter r. Always check the scatterplot.
  • r = 0 does not mean "no relationship." It means no linear relationship. A perfectly U-shaped or sinusoidal pattern can produce r ≈ 0.
  • Beware of restricted range. Calculating r on a narrow subset of x values will underestimate the correlation that exists across the full range.

Worked Example — Computing r by Hand

A researcher records the hours studied (x) and exam scores (y) for five students: (2, 65), (4, 73), (5, 80), (7, 85), (9, 92). Compute the Pearson correlation coefficient r.

Calculating r from Raw Data
1
Step 1 — Compute Meansx̄ = (2 + 4 + 5 + 7 + 9) / 5 = 27 / 5 = 5.4 and ȳ = (65 + 73 + 80 + 85 + 92) / 5 = 395 / 5 = 79.0.
x̄ = 5.4, ȳ = 79.0
2
Step 2 — Compute Deviations and ProductsFor each pair, calculate (xᵢ − x̄), (yᵢ − ȳ), and their product: (−3.4)(−14) = 47.6; (−1.4)(−6) = 8.4; (−0.4)(1) = −0.4; (1.6)(6) = 9.6; (3.6)(13) = 46.8. Sum of products = 112.0. Also compute Σ(xᵢ − x̄)² = 11.56 + 1.96 + 0.16 + 2.56 + 12.96 = 29.2 and Σ(yᵢ − ȳ)² = 196 + 36 + 1 + 36 + 169 = 438.
Σ(xᵢ − x̄)(yᵢ − ȳ) = 112.0
3
Step 3 — Compute Standard Deviationssₓ = √(29.2 / 4) = √7.3 ≈ 2.702. sᵧ = √(438 / 4) = √109.5 ≈ 10.464.
sₓ ≈ 2.702, sᵧ ≈ 10.464
4
Step 4 — Apply the Formular = [1 / (n − 1)] × Σzₓzᵧ. Equivalently, r = Σ(xᵢ − x̄)(yᵢ − ȳ) / [(n − 1) × sₓ × sᵧ] = 112.0 / [4 × 2.702 × 10.464] = 112.0 / 113.14 ≈ 0.990.
r ≈ 0.990
5
Step 5 — InterpretThere is a strong, positive, linear association between hours studied and exam score. Approximately r² ≈ 0.980, meaning about 98% of the variation in exam scores is explained by the linear relationship with study hours in this small dataset.

Strengths and Limitations of Correlation

Key strengths and limitations of the Pearson correlation coefficient
StrengthsLimitations
Provides a single, easy-to-communicate numerical summary of linear association.Captures only linear relationships; misses curves, thresholds, and other patterns.
Unitless and scale-invariant—unaffected by changes in measurement units.Highly sensitive to outliers; a single influential point can distort r dramatically.
Directly linked to r², providing an intuitive 'percent explained' interpretation.Cannot establish causation—lurking variables and confounders are invisible to r.
Symmetric: the correlation of x with y equals the correlation of y with x.Restricted range of data artificially attenuates r, leading to underestimates.
KEY TAKEAWAY
Correlation is like a one-dimensional X-ray of a potentially complex two-dimensional relationship. It reveals the linear skeleton beautifully, but it cannot capture curves, clusters, or subgroup structure. Always pair r with a scatterplot—just as a physician uses multiple imaging modalities rather than relying on a single scan.

Connection to Regression and Advanced Methods

Correlation is the gateway to least-squares regression, the next major topic in AP Statistics. The slope of the least-squares regression line is directly tied to r by the relationship b₁ = r × (sᵧ / sₓ), meaning that knowing the correlation, along with the two standard deviations, fully determines the regression slope. Similarly, the coefficient of determination r² reappears as the key measure of model fit in regression output. Understanding correlation deeply prepares you for interpreting computer output, performing residual analysis, and eventually extending to multiple regression in college-level coursework.

Correlation vs. regression — building from description to prediction
ConceptCorrelation (r)Regression
PurposeMeasures strength and direction of linear associationModels the relationship and predicts y from x
SymmetrySymmetric: r(x, y) = r(y, x)Asymmetric: regression of y on x ≠ regression of x on y
OutputA single number between −1 and +1An equation: ŷ = b₀ + b₁x, plus residuals
Role of r²Proportion of shared variabilityProportion of y-variability explained by the model

Beyond the AP curriculum, statisticians employ partial correlation (controlling for confounders), Spearman's rank correlation (for ordinal or non-normal data), and matrix-based correlation analysis (in multivariate settings). Each of these extensions traces its lineage directly back to Pearson's original r, making a solid grasp of this concept indispensable for advanced study.

Practice Problems

1
A scatterplot of two quantitative variables shows a strong, curved (U-shaped) pattern. The Pearson correlation coefficient r is most likely closest to which value?
2
If r = −0.85 for the relationship between outdoor temperature (°F) and monthly heating bill ($), what is the correct interpretation of r² = 0.7225?
3
A researcher converts outdoor temperature from Fahrenheit to Celsius and recalculates the correlation with heating bill. The original correlation was r = −0.85. What is the new r?
PROBLEM 4APPLIED
A biologist measures wing length (cm) and body mass (g) for 8 birds of the same species. The data yield: Σxᵢ = 80, Σyᵢ = 200, Σxᵢ² = 840, Σyᵢ² = 5200, Σxᵢyᵢ = 2080, n = 8. (a) Compute the correlation coefficient r. (b) Interpret r in context. (c) Compute and interpret r². (d) A colleague notes that one very large bird may be an outlier. Explain how removing it could affect r.
PROBLEM 5CRITICAL THINKING
A national study finds a correlation of r = +0.92 between per-capita cheese consumption and the number of civil engineering doctorates awarded each year (both measured annually over 10 years). (a) Does this correlation provide evidence that eating cheese causes more people to earn engineering doctorates? Explain. (b) Identify at least two lurking variables that could account for this correlation. (c) Describe a study design that could better establish a causal relationship between two variables. (d) Explain why time-series data (variables measured over successive years) often produce high correlations even between unrelated variables.

Lesson Summary

The Pearson correlation coefficient r quantifies the direction and strength of a linear relationship between two quantitative variables on a scale from −1 to +1. It is computed by averaging the products of standardized z-scores, making it unitless and invariant to linear transformations. The coefficient of determination r² tells us the proportion of variability in y explained by the linear model.

Critical caveats include: r measures only linear association (curved patterns can produce r ≈ 0); correlation does not imply causation; and r is sensitive to outliers. Always accompany the numerical value of r with a scatterplot to verify that the linear model is appropriate. Mastering correlation provides the essential foundation for least-squares regression and the broader inferential framework of AP Statistics.

Varsity Tutors • AP Statistics • Correlation