AP subjects/AP Statistics/Correlation Coefficient Explorer
CED 5.2AP Statistics

Correlation Coefficient Explorer

Use this free correlation coefficient explorer to see what the value of rr says about a scatterplot, and what it does not. Set a target correlation and a 26-point scatterplot is redrawn, with the actual rr, r2r^2 and a strength label beside it.

Controls
curveBtnrslider

How to use the simulator

  • Target r: a slider from −1 to 1 in steps of 0.01 (default +0.80). Moving it regenerates the scatterplot to match.
  • Quick pattern buttons: Strong + (0.95), Moderate + (0.5), None (0), Moderate − (−0.5) and Strong − (−0.95) set the slider for you. Curved (U) replaces the cloud with a U-shaped pattern, and the target label changes to "(curved)".
The readout shows the actual computed r to three decimal places with its sign, a strength label, r2 (variation explained) and points n, which is always 26. The actual r is calculated from the plotted points, so it is close to the target but not always equal: a target of +0.80 gives +0.797, and None gives −0.013.
The strength label uses the simulator's own cutoffs: below 0.05 in size is "No Correlation", below 0.4 is Weak, below 0.7 is Moderate and anything larger is Strong. A target of 0.70 produces r = +0.695, which is labelled Moderate. These cutoffs are a convenience, not an AP rule; on the exam you judge strength from the graph and the value together.
Both axes run from 0 to 1 with no units, and the points are rescaled each time to fill the plot. As you move the slider the cloud's overall tilt barely changes; what changes is how tightly the points hug a line. That is exactly what r measures.

The formula

The formula sheet writes the correlation as the average product of z-scores, dividing by n − 1:
r=1n−1∑(xi−xˉsx)(yi−yˉsy)r = \frac{1}{n-1}\sum \left(\frac{x_i - \bar{x}}{s_x}\right)\left(\frac{y_i - \bar{y}}{s_y}\right)
  • −1≤r≤1-1 \le r \le 1. The sign gives the direction, and the size gives the strength of the linear association.
  • r=±1r = \pm 1 only when every point lies exactly on a line.
  • rr has no units. Changing units (inches to centimetres, say) or swapping x and y does not change it.
  • rr is not resistant: one outlier can raise or lower it a lot.
  • rr is not the slope. The two are linked by b=r sysxb = r\,\dfrac{s_y}{s_x}, so they always share a sign but usually differ in size.
  • r2r^2 is the proportion of the variation in y that is accounted for by the linear model with x.

Worked example

Problem: Five students recorded hours of practice (x) and a quiz score out of 5 (y): (1, 2), (2, 4), (3, 5), (4, 4), (5, 5). Find and interpret r and r2r^2.
Step 1: Means and standard deviations. xˉ=3\bar{x} = 3, sx=1.581s_x = 1.581; yˉ=4\bar{y} = 4, sy=1.225s_y = 1.225.
Step 2: z-scores. For x: −1.265, −0.632, 0, 0.632, 1.265. For y: −1.633, 0, 0.816, 0, 0.816.
Step 3: Products. (−1.265)(−1.633)=2.066(-1.265)(-1.633) = 2.066, then 0, 0, 0, and (1.265)(0.816)≈1.033(1.265)(0.816) \approx 1.033. The sum is 3.098.
Step 4: Divide by n − 1. r=3.098/4=0.775r = 3.098/4 = 0.775, and r2=0.600r^2 = 0.600.
Interpretation: there is a fairly strong, positive, linear association between hours of practice and quiz score for these students. About 60% of the variation in quiz score is accounted for by the linear relationship with hours of practice. The slope of the regression line would be b = 0.775 × 1.225 / 1.581 = 0.6 points per hour, a different number from r.
Check it in the simulator: set the target to +0.77. The readout shows r = +0.767, labelled Strong Positive, with r2 = 0.588. Now slide to −0.77: the cloud slopes down instead, r reads −0.773, and the spread around the line looks the same. The sign changed the direction, not the strength.

Common mistakes on the AP exam

  • Incomplete descriptions. Describing a scatterplot needs direction, form, strength and any unusual features, all in context. Giving only "r = 0.775" is not enough.
  • Reading r as a slope. r = 0.775 does not mean the score rises 0.775 points per hour; the slope in the example is 0.6.
  • Assuming r near 0 means no relationship. Press Curved (U): the pattern is obvious, but r = −0.056. r only measures linear association, so always look at the graph.
  • Confusing r and r2. r2 = 0.60 is a proportion of variation explained. It is not the proportion of points on the line or the probability of a correct prediction.
  • Losing the sign. If you are given r2 = 0.64, then r = 0.8 or −0.8; take the sign from the slope or the graph.
  • Claiming causation. A strong correlation from observational data does not show that x causes y. Only a well-designed experiment supports that.
  • Giving r units. r is unit-free, and converting the variables' units leaves it unchanged.

When the AP exam uses this

Correlation is topic 5.2 in Unit 5 (Regression Analysis). Expect to match scatterplots to values of r, interpret r and r2 in context from computer output, and explain how an outlier or a curved pattern affects r. It also leads straight into the least-squares line in topic 5.5, through b = r sy/sx.
Embed this simulator on your class page

Free for classroom use. Paste this into your site, LMS page or blog; keep the credit link under it.