A brief note on Scatter Plots and Correlation . Read it before a test. Try each question at the end before you open its answer.
Scatter plots One dot for each individual, the explanatory variable x x x across and the response y y y up. Four words: direction (positive or negative), form (linear, curved, clusters), strength (strong or weak), outliers. Centre: the point of the means ( x ˉ , y ˉ ) (\bar{x}, \bar{y}) ( x ˉ , y ˉ ) . The correlation coefficient Sums: S x x = ∑ ( x − x ˉ ) 2 S_{xx} = \sum (x - \bar{x})^2 S xx = ∑ ( x − x ˉ ) 2 , S y y = ∑ ( y − y ˉ ) 2 S_{yy} = \sum (y - \bar{y})^2 S y y = ∑ ( y − y ˉ ) 2 , S x y = ∑ ( x − x ˉ ) ( y − y ˉ ) S_{xy} = \sum (x - \bar{x})(y - \bar{y}) S x y = ∑ ( x − x ˉ ) ( y − y ˉ ) . Formula: r = S x y S x x S y y r = \dfrac{S_{xy}}{\sqrt{S_{xx}S_{yy}}} r = S xx S y y S x y . With z-scores: r = 1 n − 1 ∑ z x z y r = \dfrac{1}{n - 1}\sum z_x z_y r = n − 1 1 ∑ z x z y (sample standard deviations). Range: − 1 ≤ r ≤ 1 -1 \le r \le 1 − 1 ≤ r ≤ 1 . The sign is the direction and the size is the strength. No unit. A new unit, or adding a number, leaves r r r alone. A negative factor changes its sign. What r cannot see Curves: a strong curve can give r r r near 0 0 0 . Outliers: one point can change r r r a lot. Slope and cause: r r r gives neither. Range: a narrow range of x x x usually lowers r r r . A worked example A made-up lemonade stall records the noon temperature and the cups sold on four days: ( 20 , 15 ) (20, 15) ( 20 , 15 ) , ( 24 , 21 ) (24, 21) ( 24 , 21 ) , ( 28 , 22 ) (28, 22) ( 28 , 22 ) and ( 32 , 30 ) (32, 30) ( 32 , 30 ) , temperature in ∘ C ^\circ\text{C} ∘ C first.
Means. x ˉ = 26 ∘ C \bar{x} = 26\ ^\circ\text{C} x ˉ = 26 ∘ C and y ˉ = 22 \bar{y} = 22 y ˉ = 22 cups. Sums. S x x = 80 S_{xx} = 80 S xx = 80 , S y y = 114 S_{yy} = 114 S y y = 114 and S x y = 92 S_{xy} = 92 S x y = 92 . r. r = 92 80 × 114 = 0.9634 r = \dfrac{92}{\sqrt{80 \times 114}} = 0.9634 r = 80 × 114 92 = 0.9634 , a strong positive pattern. Practice with new numbers
A program to try The program finds the sums and r r r of the worked example, and checks r r r with the statistics module.
Run it. Do the two values of r r r agree?
1. Change the last cups sold from 30 to 18. Predict whether r r r goes up or down, then run it.
Mistakes to avoid Dividing by n n n with sample standard deviations. Use n − 1 n - 1 n − 1 . Calling a negative r r r weak. The size gives the strength. Saying r = 0 r = 0 r = 0 means no relationship. It means no straight-line relationship. Trusting r r r without the plot. Draw the scatter plot first. Check yourself Which shows the stronger straight-line pattern, r = − 0.7 r = -0.7 r = − 0.7 or r = 0.5 r = 0.5 r = 0.5 ? Stuck? Show a hint Show the answerThree points have ( x − x ˉ , y − y ˉ ) (x - \bar{x}, y - \bar{y}) ( x − x ˉ , y − y ˉ ) of ( − 2 , − 1 ) (-2, -1) ( − 2 , − 1 ) , ( 0 , 0 ) (0, 0) ( 0 , 0 ) and ( 2 , 1 ) (2, 1) ( 2 , 1 ) . Find r r r . Stuck? Show a hint Show the answerA data set gives r = 0.85 r = 0.85 r = 0.85 . Every x x x is multiplied by − 2 -2 − 2 . What is the new r r r ? Stuck? Show a hint Show the answerPoints follow a hill shape: they rise and then fall. What will r r r be close to? Stuck? Show a hint Show the answerSources OpenStax, Introductory Statistics , Chapter 12 (Linear Regression and Correlation).