AP Statistics • Exploring Two-Variable Data

Correlation

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

A scatter plot with data columns and a percentage symbol.
Inside this lesson 10 sections 5 questions 7 figures

SECTION 1

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.

SECTION 2

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.

SECTION 3

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.

Scatterplot Patterns by Correlation Strengthr ≈ +0.95Strong +r ≈ +0.60Moderate +r ≈ 0.00No linearr ≈ −0.60Moderate −r ≈ −0.95Strong −← Points cluster tightly around a line as |r| → 1. A circular cloud signals r ≈ 0. →−1.0−0.50.0+0.5+1.0Correlation Spectrum: direction (sign) × strength (magnitude)
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.

SECTION 4

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))×Σ[(xi−xˉ)/sx]×[(yi−yˉ)/sγ]r = (1 / (n − 1)) × Σ [ (xᵢ − x̄) / sₓ ] × [ (yᵢ − ȳ) / sᵧ ]

where n = number of data pairs, x̄ 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Σxiyi−(Σxi)(Σyi)]/√[nΣxi2−(Σxi)2]×√[nΣyi2−(Σyi)2]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

r2=(fractionofvariationinyexplainedbythelinearrelationshipwithx)r² = (fraction of variation in y explained by the linear relationship with x)

Squaring r gives r², 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.

SECTION 5

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.

Four Pitfalls of CorrelationA. Nonlinear Relationship (r ≈ 0)B. Influential Outlier (r inflated)outlierC. Lurking Variable (Confounding)r is high but driven by a third variable ZZ confoundsD. Grouped Data (Simpson-like)Overall r is positive; within each group, r is negative
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.

SECTION 6

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. 1

    Step 1 — Compute Means

    x̄ = (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. 2

    Step 2 — Compute Deviations and Products

    For 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. 3

    Step 3 — Compute Standard Deviations

    sₓ = √(29.2 / 4) = √7.3 ≈ 2.702. sᵧ = √(438 / 4) = √109.5 ≈ 10.464.
    sₓ ≈ 2.702, sᵧ ≈ 10.464
  4. 4

    Step 4 — Apply the Formula

    r = [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. 5

    Step 5 — Interpret

    There 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.

SECTION 7

Strengths and Limitations of Correlation

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 strengths and limitations of the Pearson correlation coefficient

✦

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.

SECTION 8

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.

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

Correlation vs. regression — building from description to prediction

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.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

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?
  • A. +0.95
  • B. +0.50
  • C. 0.00
  • D. −0.50
  • E. −0.95
Show answer (C)
C is correct. The Pearson correlation coefficient measures only linear association. A symmetric U-shaped curve has equal positive and negative linear components that cancel, yielding r ≈ 0 despite a strong overall relationship. Choice A (+0.95) and B (+0.50) are wrong because a symmetric U-shape does not consistently rise from left to right. Choice D (−0.50) and E (−0.95) are wrong because it does not consistently fall either. This illustrates why r = 0 does not mean 'no relationship'—it means no linear relationship.

Question 2: BASIC CALCULATION

If r = −0.85 for the relationship between outdoor temperature (°F) and monthly heating bill ($), what is the correct interpretation of r² = 0.7225?
  • A. 72.25% of the variation in heating bills is explained by the linear relationship with outdoor temperature.
  • B. 72.25% of heating bills are caused by changes in outdoor temperature.
  • C. The heating bill decreases by 72.25% for each degree increase in temperature.
  • D. There is a 72.25% chance that the relationship is linear.
  • E. 85% of the variation in heating bills is explained by temperature.
Show answer (A)
A is correct. r² represents the proportion of variability in the response variable (heating bill) that is accounted for by the linear relationship with the explanatory variable (temperature). B is wrong because r² describes explained variation, not causation—the data may be observational. C is wrong because it confuses r² with a slope or rate of change. D is wrong because r² is not a probability statement about linearity. E is wrong because it confuses r (−0.85) with r²; squaring −0.85 gives 0.7225, not 0.85.

Question 3: INTERMEDIATE

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?
  • A. −0.85
  • B. +0.85
  • C. −0.47
  • D. It cannot be determined without the data.
  • E. −1.53
Show answer (A)
A is correct. Correlation is invariant under linear transformations of the form x' = a + bx when b > 0. Converting °F to °C uses C = (5/9)(F − 32), which is a positive linear transformation—the z-scores remain unchanged. B is wrong because a positive linear transformation does not flip the sign. C is wrong—there is no basis for reducing the magnitude. D is wrong because the invariance property is guaranteed mathematically. E is wrong because r is bounded between −1 and +1; −1.53 is impossible.

Question 4: APPLIED

4 pts
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.
Show answer
Rubric (4 points): Point 1 — Correct computation of r: Using the computational formula: numerator = nΣxᵢyᵢ − (Σxᵢ)(Σyᵢ) = 8(2080) − (80)(200) = 16640 − 16000 = 640. Denominator = √[8(840) − 80²] × √[8(5200) − 200²] = √[6720 − 6400] × √[41600 − 40000] = √320 × √1600 = 17.889 × 40 = 715.54. r = 640 / 715.54 ≈ 0.894. Point 2 — Contextual interpretation of r: There is a strong, positive, linear association between wing length and body mass for these birds. Birds with longer wings tend to have greater body mass. Point 3 — r² computation and interpretation: r² ≈ 0.894² ≈ 0.799. Approximately 79.9% of the variability in body mass is explained by the linear relationship with wing length. Point 4 — Effect of removing an outlier: If the large bird lies near the overall trend (i.e., it is consistent with the linear pattern), removing it could decrease r because it extends the range and adds a point that fits the line. If it deviates from the linear trend (an influential outlier pulling the line), removing it could increase r by reducing distortion. Without seeing the scatterplot, the direction of change cannot be determined with certainty—this illustrates why we always examine plots.

Question 5: CRITICAL THINKING

4 pts
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.
Show answer
Rubric (4 points): Point 1 — No causal conclusion: No. Correlation does not imply causation. This is an observational study with no random assignment of cheese consumption, so confounding variables may explain the association. A high r value alone, regardless of magnitude, cannot establish cause and effect. Point 2 — Lurking variables (two required): (1) Population growth: as the U.S. population increases over time, both per-capita food consumption patterns change and more people attend graduate school. (2) Economic growth / GDP: a growing economy increases both consumer spending (including dairy products) and government/university funding for doctoral programs. Both variables may simply be trending upward due to these shared underlying causes. Point 3 — Better study design: A randomized controlled experiment would provide stronger evidence for causation. For example, randomly assigning participants to different dietary conditions and measuring outcomes. However, since we cannot ethically or practically force doctoral enrollment, the student should note that a well-designed observational study with statistical controls for confounders (e.g., regression controlling for GDP, population, and time trend) would be a more realistic improvement. Point 4 — Spurious correlation in time-series: Many variables increase or decrease steadily over time (they share a common time trend). When two variables both trend upward (or downward) simply because of the passage of time, they will appear highly correlated even if they have no causal connection. This is sometimes called a spurious correlation due to a common temporal trend. Analysts address this by detrending or differencing the data before computing correlation.

SUMMARY

Lesson Summary

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