12.2 Scatterplots
A scatterplot shows the relationship between two quantitative variables measured on the same individuals.
- The predictor variable is labeled on the horizontal or -axis.
- The response variable is labeled on the vertical or -axis.
How to Interpret a Scatterplot:
- Look for the overall pattern and for deviations from that pattern.
- Look for outliers, individual values that fall outside the overall pattern of the relationship.
- A positive linear relation results when larger values of one variable are associated with larger values of the other.
- A negative linear relation results when larger values of one variable are associated with smaller values of the other.
- A scatterplot has no association if no obvious linear pattern is present.
Correlation Coefficient
The sample correlation coefficient measures the direction and strength of the linear relationship between two quantitative variables. There are several different types of correlations. We will be using the Pearson Product Moment Correlation Coefficient (PPMCC). The PPMCC is named after biostatistician Karl Pearson. We will just use the lower-case for short when we want to find the correlation coefficient, and the Greek letter , pronounced “rho,” (rhymes with sew) when referring to the population correlation coefficient.

Interpreting the Correlation:
- A positive indicates a positive association (positive linear slope).
- A negative indicates a negative association (negative linear slope).
- is always between and , inclusive.
- If is close to or , there is a strong linear relationship between and .
- If is close to , there is a weak linear relationship between and . There may be a non-linear relation or there may be no relation at all.
- Like the mean, is strongly affected by outliers. Figure 12-1 gives examples of correlations with their corresponding scatterplots.

When you have a correlation that is very close to or , then the points on the scatter plot will line up in an almost perfect line. The closer gets to , the more scattered your points become.
Example 2
Take a moment and see if you can guess the approximate value of for the scatter plots below.

Show solution
Scatterplot A: , Scatterplot B: , Scatterplot C: .
When is equal to or all the dots in the scatterplot line up in a straight line. As the points disperse, gets closer to zero. The correlation tells the direction of a linear relationship only. It does not tell you what the slope of the line is, nor does it recognize nonlinear relationships. For instance, in Figure 12-2, there are three scatterplots overlaid on the same set of axes. All three data sets would have even though they all have different slopes.

For the next example in Figure 12-3, would indicate no linear relationship; however, there is clearly a non-linear pattern with the data.

Figure 12-4 shows a correlation , which is pretty close to one, indicating a strong linear relationship. However, there is an outlier, called a leverage point, which is inflating the value of the slope. If you remove the outlier then , and there is no up or down trend to the data.

Calculating Correlation
To calculate the correlation coefficient by hand we would use the following formula.
Note
Sample Correlation Coefficient
Instead of doing all of these sums by hand we can use the output from summary statistics. Recall that the formula for a variance of a sample is . If we were to multiply both sides by the degrees of freedom, we would get .
We use these sums of squares frequently, so for shorthand we will use the notation . The same would hold true for the variable; just changing the letter, the variance of would be , therefore .
The numerator of the correlation formula is taking in the horizontal distance of each data point from the mean of the values, times the vertical distance of each point from the mean of the values. This is time-consuming to find so we will use an algebraically equivalent formula , and for short we will use the notation .
To start each problem, use descriptive statistics to find the sum of squares.
Example 3
Use the following data to calculate the correlation coefficient.
Try it in XYZ Crunch
From 2-Var Stats to r, the book's way
The first link preloads the exam data in the Stats panel: read off x-bar = 16.6, sx = 1.723783, y-bar = 80.1333, sy = 6.717426 and build the sums of squares by hand - SSxx = 14(1.723783)^2 = 41.6, SSyy = 631.7333, SSxy = 133.8. The second link opens the Regression panel on the same data to confirm r.
Hours Studied for Exam 20 16 20 18 17 16 15 17 15 16 15 17 16 17 14 Grade on Exam 89 72 93 84 81 75 70 82 69 83 80 83 81 84 76
Show solution
We could show all the work the long way by hand using the shortcut formula. On the TI-83 press the [STAT] key and then the [EDIT] function, type the values into L1 and the y values into L2. Press the [STAT] key again and arrow over to highlight [CALC], select 2-Var Stats, then press [ENTER]. This will return the descriptive stats.
The TI calculator can run descriptive statistics and quickly get everything we need to find the sum of squares. Go to STAT > CALC > 2-Var Stats. For TI-83, you may need to enter your list names separated by a comma, for example 2-Var Stats L1,L2 then hit enter. On the TI-89, open the Stats/List Editor. Enter all -values in one list. Enter all corresponding -values in a second list. Press F4, then select 2-Var Stats, then press [ENTER]. This will return the descriptive stats. Use the down arrow to see everything.

Once you do this the statistics are stored in your calculator so you can use the VARS key, go to Statistics, then select the standard deviation for , and repeat for the -variable. This will reduce rounding errors by using exact values. For the you can also use the stored sum of and means.

This gives the following results:
Note that both and will always be positive, but could be negative or positive. For the TI-89, you will see the sum of squares at the very bottom of the descriptive statistics: and .
To find the correlation, substitute the three sums of squares into the formula to get: . Try this now on your calculator to see if you are getting your order of operations correct.
For our example, is close to 1; therefore it looks like there is positive linear relationship between the number of hours studying for an exam and the grade on the exam.
Most software has a built-in correlation function.
TI-84: On the TI-83 press the [STAT] key and then the [EDIT] function, type the values into L1 and the values into L2. Press the [STAT] key again and arrow over to highlight [TEST], select LinRegTTest, then press [ENTER]. The default is Xlist: L1, Ylist: L2, Freq:1, and . Arrow down to Calculate and press the [ENTER] key. Scroll down to the bottom until see you .

TI-89: On the TI-89, open the Stats/List Editor. Enter all -values in one list. Enter all corresponding -values in a second list. Press F6, then select LinRegTTest, then press [ENTER]. Scroll down to the bottom of the output to see .

Excel:

r = CORREL(array1,array2) = CORREL(B1:P1,B2:P2) = 0.8254
When is a correlation statistically significant? The next subsection shows how to run a hypothesis test for correlations.
Adapted from Mostly Harmless Statistics by Rachel Webb (Portland State University), hosted on LibreTexts (stats.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.