The section that comes before any arithmetic, and says so: before taking up linear regression and correlation, the relation between two variables has to be looked at. A scatter plot is the most common and easiest way to display it, and three things are read off one — the direction of the relationship, its strength, and the overall pattern together with any deviations from it. A clear direction means either that high values of one variable occur with high values of the other, or that high values of one occur with low values of the other. Strength is judged by how close the points fall to a line or some other curve, with one exception the book flags: points lying exactly on a horizontal line look like a perfect fit and in fact show no relationship, since y is the same whatever x does. The section closes with the condition for going further, which is that one variable must actually help explain or predict the other.
Subject: Statistics · 64 slides · symbolic lesson
Open the interactive version of this deck
Title
Statistics · Chapter 12 — Linear Regression and Correlation
Look at two variables together before you calculate anything
Objectives
Every display so far in this course has shown one variable at a time: a histogram of heights, a box plot of exam scores. Chapter 12 is about two variables measured on the same individuals, and whether one helps predict the other. Before any line or any coefficient, you have to look, and the scatter plot is how you look.
The arithmetic in this section is light: a few differences and a little counting. What this section trains is judgement. Every later number in the chapter, the regression line, the correlation and its test, is only as trustworthy as the look you take here.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 620-623 — the section this deck covers
Warm-up
Section 12.1 wrote exact straight lines. Recall how to read one, because the same vocabulary of independent and dependent variable carries straight into scatter plots.
Discussion prompt
Svetlana charges a one-time fee of 25 dollars plus 15 dollars per hour of tutoring, so her earnings for a session are y = 25 + 15x. Which variable is independent, which is dependent, and what do the 25 and the 15 mean?
Notice which way the explanation runs. Hours determine earnings, not the other way round, so hours go on the horizontal axis. In Section 12.1 every point sat exactly on the line because the rule was exact.
Real data never behave like that. Two children of the same age know different numbers of words. This section is about how to look at data that only roughly follow a rule, and how to tell whether there is a rule there at all.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.1, p. 620 — Example 12.4
Section
Part 1
Concept
Example 12.5 has an educational researcher recording two things about each of four young children: the child's age and the size of the child's vocabulary. That is paired data. Each child contributes one pair of numbers, and the pairing matters.
| child | age (years) | vocabulary (words) |
|---|---|---|
| 1 | 3 | 655 |
| 2 | 4 | 1098 |
| 3 | 6 | 2463 |
| 4 | 7 | 3195 |
You already know how to display each column on its own. Here are the two dot plots Chapters 2 and 3 would draw.
Figure (svg): Two separate dot plots. The upper one shows the four ages 3, 4, 6 and 7 on a line from 0 to 8 years. The lower one shows the four vocabulary sizes 655, 1098, 2463 and 3195 on a line from 0 to 3500 words. Nothing links a dot in one plot to a dot in the other.
Each plot is a fair picture of its own variable, and neither can answer the researcher's question, which is whether older children know more words. To answer that you have to keep each age next to its own vocabulary. The scatter plot does exactly this: it uses the horizontal axis for one variable and the vertical axis for the other, so each child becomes one point.
scatter plot — A graph of paired data in which each individual is drawn as one point, its x value read across and its y value read up. It displays the relation between two quantitative variables.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 620 — Example 12.5 and Table 12.1
Concept
A scatter plot has two axes and you must decide which variable gets which. The book's rule comes from Section 12.1: the independent variable, the one that does the explaining, is x and goes across; the dependent variable, the one that responds, is y and goes up.
\[ x = \text{independent (explanatory)}, \qquad y = \text{dependent (response)} \]
In Example 12.5 the book says it outright: let x be the child's age and y the vocabulary size. Age is not caused by vocabulary; a child does not get older by learning words. Vocabulary grows as the child ages. So age explains, and vocabulary responds.
Sometimes the choice is about time order rather than cause. In Example 12.6 a third exam comes before the final exam, so the third exam score is x and the final is y: you know the earlier score first and want to predict the later one.
When neither variable clearly explains the other, say height and arm span, either choice gives a fair picture. But the choice will matter in Section 12.3, because a regression line predicts y from x and not the reverse, so get into the habit of asking which way the explanation runs before you draw a single point.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 620, 623 — x = child's age, y = vocabulary size; the closing paragraph
Notation
The chapter writes paired data compactly. Every symbol below appears again in Sections 12.3 to 12.5, so it is worth decoding once now.
Annotate
On: \( (x_1, y_1), \; (x_2, y_2), \; \ldots, \; (x_n, y_n) \)
Two habits follow from the notation. First, count your points against n: a plot of Example 12.6 with ten dots instead of eleven has lost a student. Second, read each pair in order, across and then up, exactly as you would plot a point in algebra.
\[ n = 4: \quad (3, 655), \; (4, 1098), \; (6, 2463), \; (7, 3195) \]
The subscripts never mean that the data are sorted. Table 12.3 lists the exam scores in the order the students were sampled, not by score, and the plot does not care about that order at all.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 620 — Table 12.1
Worked example
An educational researcher collects data on the vocabulary size of children as a function of age, shown in Table 12.1. Construct a scatter plot, with x the child's age and y the vocabulary size.
Constructing a plot is a short sequence of decisions: which variable on which axis, how far each axis must run, and then one point per row. Getting the axes right first saves redrawing later, so do them before the dots.
Assign the axes
Why: age explains vocabulary, so age is x.
\[ x = \text{age (years)}, \quad y = \text{vocabulary (words)} \]
Find the range of x
Why: the axis must cover the smallest and largest age.
\[ \min x = 3, \quad \max x = 7 \;\Rightarrow\; \text{axis } 0 \text{ to } 8 \]
Find the range of y
Why: the same for the vocabulary sizes.
\[ \min y = 655, \quad \max y = 3195 \;\Rightarrow\; \text{axis } 0 \text{ to } 3500 \]
Choose tick spacing
Why: even steps that make the values easy to place.
\[ \text{x every } 1 \text{ year}, \quad \text{y every } 500 \text{ words} \]
Plot one point per row
Why: across to the age, up to the vocabulary.
\[ (3, 655), \; (4, 1098), \; (6, 2463), \; (7, 3195) \]
Figure (svg): A scatter plot with child's age in years from 0 to 8 across and vocabulary size from 0 to 3500 words up. Four points at (3, 655), (4, 1098), (6, 2463) and (7, 3195). Dashed guides run from the point (6, 2463) down to 6 on the horizontal axis and across to 2463 on the vertical axis.
Why not start both axes at the first data value? You can, and the calculator does. Starting at zero here shows that a three-year-old already knows hundreds of words; starting at the data shows the climb more sharply. Either is honest as long as the axes are labelled and every point is on the screen.
This is Figure 12.5 in the book. A graphing calculator's ZoomStat does the range steps for you: it sets the window from the smallest to the largest value in each list. Whether you draw by hand or by machine, the window has to contain every point, or a point silently disappears.
Check the point count and one reading
Why: four rows must give four points, and each must read back to its row.
\[ n = 4 \text{ points}; \quad (6, 2463): \text{ across } 6, \text{ up } 2463 \;\checkmark \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 620-621 — Example 12.5, Table 12.1 and Figure 12.5
Concept
The book gives keystrokes for drawing a scatter plot on a TI-83 or TI-84. You do not need the calculator, but it is worth seeing that each keystroke is one of the decisions you just made by hand, so you know what the machine is choosing for you.
| calculator step | the decision behind it |
|---|---|
| enter x data in L1, y data in L2 | which variable is x: the calculator cannot know |
| keep each row's pair on the same line of both lists | the pairing: one child per row |
| Plot 1 on, TYPE: the first icon | a scatter plot, not a line graph that joins the dots |
| clear any equations under Y= | nothing but the data on the screen |
| ZOOM 9, ZoomStat | the window: from the smallest to the largest value in each list |
The first row is the one the machine cannot do for you. Typing vocabulary into L1 and ages into L2 produces a perfectly good-looking plot of the wrong question. The second row is the one that fails silently: delete one value from one list and every pair after it shifts, so each child is paired with the next child's vocabulary.
\[ \text{ZoomStat: } [\min x, \max x] \times [\min y, \max y] = [3, 7] \times [655, 3195] \]
ZoomStat sets the window to the range of each list, with a little padding. That is exactly the window a fair judgement of strength needs, which matters in Part 3: a window much larger than the data makes any cloud look tighter than it is.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 621 — Using the TI-83, 83+, 84, 84+ calculator
Worked example
The book's question is whether there is a relationship between age and vocabulary size for young children. The plot suggests yes. Here is how to say so with evidence rather than an impression, by walking from each child to the next older one.
The idea: if older always means more words, then every step to the right must also be a step up. Compute the rise per year for each step and look at the signs. One step down would already weaken the claim.
From age 3 to age 4
Why: the change in words over the change in years.
\[ \frac{1098 - 655}{4 - 3} = \frac{443}{1} = 443 \text{ words per year} \]
From age 4 to age 6
Why: two years apart, so divide by 2.
\[ \frac{2463 - 1098}{6 - 4} = \frac{1365}{2} = 682.5 \text{ words per year} \]
From age 6 to age 7
Why: one year apart.
\[ \frac{3195 - 2463}{7 - 6} = \frac{732}{1} = 732 \text{ words per year} \]
Read the signs
Why: all three rises are positive.
\[ 443 > 0, \quad 682.5 > 0, \quad 732 > 0 \]
Figure (svg): The vocabulary scatter plot again, with an arrow from each point to the next. The arrows are labelled with the rise per year: 443 from age 3 to 4, 682.5 per year from age 4 to 6, and 732 from age 6 to 7. All three arrows point up and to the right.
Why divide by the gap in ages? The step from 4 to 6 spans two years, so its raw rise of 1365 words would look twice as steep as it is. Dividing by the gap puts every step on the same footing: words per year.
In context: in this sample, each older child knew more words than each younger child, and the gain ran from about 440 to about 730 words per year. The rises grow slightly with age, a hint of a gentle upward bend, but with only four children that is a hint, not a finding.
Check every pair, not just neighbours
Why: four children make six pairs; count the pairs in which the older child knows more words.
\[ \binom{4}{2} = 6 \text{ pairs}, \quad 6 \text{ rise}, \; 0 \text{ fall} \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 620 — Example 12.5: is there a relationship?
Step zero
Try It 12.5 gives Amelia's data: the hours she practised her jump shot in a week, and the points she scored in that week's game. Before you draw anything, make the decisions a plot depends on.
Discussion prompt
Which variable goes on the horizontal axis, and why? What ranges should the two axes cover? And what would the plot have to look like for Amelia's belief, that practice raises her scoring, to appear true?
Writing down what you expect to see before you plot is a habit worth keeping. If the plot agrees, you have support for the claim. If it disagrees, either the belief is wrong or the data were mis-entered, and both are worth knowing before any calculation.
Notice also what the plot cannot settle. Even a perfect climb would show that practice and points went together in these six games, not that the practice caused the points. That question comes back in Part 5.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 621-622 — Try It 12.5 and Table 12.2
Worked example
Amelia records six weeks of data: hours practising her jump shot, and points scored in a game. Construct a scatter plot and state whether what Amelia thinks, that her points rise with practice, appears to be true.
| hours practising, x | 5 | 7 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|
| points scored, y | 15 | 22 | 28 | 31 | 33 | 36 |
Assign the axes
Why: practice is claimed to explain points.
\[ x = \text{hours}, \quad y = \text{points} \]
Set the window
Why: cover 5 to 12 hours and 15 to 36 points.
\[ 4 \le x \le 13, \qquad 10 \le y \le 40 \]
Plot the six pairs
Why: one per game.
\[ (5, 15), (7, 22), (9, 28), (10, 31), (11, 33), (12, 36) \]
Figure (svg): A scatter plot with hours practising the jump shot, 4 to 13, across and points scored in a game, 10 to 40, up. Six points at (5, 15), (7, 22), (9, 28), (10, 31), (11, 33) and (12, 36), rising almost in a straight line.
Rise per hour, step by step
Why: change in points over change in hours, for each neighbouring pair.
\[ \tfrac{7}{2} = 3.5, \quad \tfrac{6}{2} = 3, \quad \tfrac{3}{1} = 3, \quad \tfrac{2}{1} = 2, \quad \tfrac{3}{1} = 3 \]
Every step is upward and the steps are nearly equal, about three points per extra hour. So the direction is positive and the points lie very close to a straight line.
The one step that differs, two points for the hour from 10 to 11, is small next to the others and goes the same way. A single smaller step inside a steady climb is ordinary game-to-game noise, not a change in the pattern. Compare that with the dive data later, where the steps shrink steadily from one end to the other.
In context: yes, what Amelia thinks appears to be true for these six games. The weeks she practised more, she scored more, at a fairly steady rate of about three points for each additional hour.
Check every pair
Why: six games make fifteen pairs; in every one the game with more practice has more points.
\[ \binom{6}{2} = 15 \text{ pairs}, \quad 15 \text{ rise}, \; 0 \text{ fall} \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 621-622 — Try It 12.5
Trap
Having plotted Amelia's six games, a first attempt connects them in table order with a line, as if it were a graph of a function:
\[ (5, 15) \to (7, 22) \to (9, 28) \to \cdots \]
Wrong. A scatter plot's points are separate individuals.
Each dot is one game, not a moment on a journey. Joining them claims there are values in between that were never observed, and the zigzag it draws depends on the order the rows happened to be typed.
\[ \text{plot } (x_i, y_i) \text{ as separate points} \]
Example 12.6 shows why the rule matters: three students scored 71 on the third exam. Joining the dots there draws a vertical spike that means nothing. The only line ever added to a scatter plot is a fitted line, in Section 12.3, chosen to summarise the whole cloud.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 621 — the calculator's scatter-plot TYPE, not the line-graph TYPE
Worked example
A random sample of 11 statistics students gives each student's third exam score, out of 80, and final exam score, out of 200. The book asks whether you can predict the final exam score if you know the third. Start by plotting it, which is where repeated values need care.
| third exam, x | 65 | 67 | 71 | 71 | 66 | 75 | 67 | 70 | 71 | 69 | 69 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| final exam, y | 175 | 133 | 185 | 163 | 126 | 198 | 153 | 163 | 159 | 151 | 159 |
Assign the axes
Why: the third exam comes first in time, so it predicts.
\[ x = \text{third exam}, \quad y = \text{final exam} \]
Find the ranges
Why: the window must hold the extremes of each list.
\[ 65 \le x \le 75, \qquad 126 \le y \le 198 \]
Find the repeated x values
Why: these will stack in vertical columns.
\[ x = 71 \text{ three times}, \quad 67 \text{ twice}, \quad 69 \text{ twice} \]
Plot every row, repeats included
Why: eleven rows, eleven points.
\[ (71, 185), \; (71, 163), \; (71, 159) \text{ all plotted} \]
Figure (svg): A scatter plot with third exam score from 64 to 76 across and final exam score from 120 to 205 up. Eleven points. Three of them sit in a vertical column at a third exam score of 71, at 159, 163 and 185, and are ringed in yellow. Two sit at 67 and two at 69.
Notice the order of the table plays no part. The rows are listed as the students were sampled, so 65 comes first and 75 sixth. The plot sorts them by position automatically, which is one more reason never to join the dots in table order.
Every row is a different student, so every row gets a point, even when two students share a third exam score. If two students had matched on both scores, you would still enter that pair twice, and on paper you would mark the dot to show it counts double.
In context: the cloud rises from left to right, so students who did better on the third exam tended to do better on the final. But the three students at 71 finished anywhere from 159 to 185, so the prediction will be rough.
Check the count
Why: the plot must show as many points as the table has students.
\[ 1 + 2 + 1 + 1 + 2 + 3 + 1 = 11 = n \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 623-624 — Example 12.6, Table 12.3 and Figure 12.9
Prediction
Look back at the exam table before you answer. Three students scored 71 on the third exam, with final scores of 185, 163 and 159. Imagine plotting them.
Predict first
When the three students who scored 71 are plotted, how many separate dots appear above the value 71 on the horizontal axis?
Correct: Three dots in a vertical column
Why: Each student is a separate individual and gets a separate point. They share an x value, so the three points sit at the same horizontal position, at heights 159, 163 and 185. Averaging them or merging them would throw away exactly the variation the plot is meant to show.
That vertical column is information, not clutter. It says that knowing a student scored 71 does not pin down the final score: it could be anywhere in a 26-point range. Part 3 uses those columns to judge how strong the relationship is.
The calculator handles this automatically, because each row of the lists becomes a point. Hand-drawn plots are where repeats go missing, usually because a second dot lands on top of the first and looks like one.
Section
Part 2
Concept
The first thing to read from a scatter plot is its direction. The book names two kinds of clear direction.
Figure (svg): Two scatter-plot panels without scales. Left: six points rising from lower left to upper right, labelled positive, high with high. Right: six points falling from upper left to lower right, labelled negative, high with low.
Read the cloud from left to right, the way the x values increase. Vocabulary and Amelia's points both climb, so both are positive. The dive data in Try It 12.6 descend, so they are negative.
The phrase low with low is part of the positive case, not a third kind. If high goes with high, then the small values of one variable sit with the small values of the other at the left of the plot: the youngest child knows the fewest words. Both ends of the same climbing cloud say the same thing.
Positive and negative here describe direction only, not quality. A negative relationship is not a bad or weak one. Deeper dives allowing less time is a perfectly strong negative relationship. Section 12.4 will give the direction a sign: the correlation coefficient is positive for a climbing cloud and negative for a falling one.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 622 — a scatter plot shows the direction of a relationship
Worked example
SCUBA divers have maximum dive times they cannot exceed when going to different depths. Table 12.4 gives six depths, in feet, with the maximum dive time in minutes. Plot the data and state the direction of the relationship.
| depth (feet), x | 50 | 60 | 70 | 80 | 90 | 100 |
|---|---|---|---|---|---|---|
| maximum dive time (minutes), y | 80 | 55 | 45 | 35 | 25 | 22 |
Assign the axes
Why: the depth sets the time limit, so depth is x.
\[ x = \text{depth (feet)}, \quad y = \text{time (minutes)} \]
Plot the six pairs
Why: one per depth in the table.
\[ (50, 80), (60, 55), (70, 45), (80, 35), (90, 25), (100, 22) \]
Figure (svg): A scatter plot with depth from 40 to 110 feet across and maximum dive time from 0 to 90 minutes up. Six points at (50, 80), (60, 55), (70, 45), (80, 35), (90, 25) and (100, 22), falling from upper left to lower right.
Change in time per 10 feet
Why: subtract each time from the next.
\[ 55 - 80 = -25, \; 45 - 55 = -10, \; -10, \; -10, \; 22 - 25 = -3 \]
Every change is negative: each deeper dive allows less time than the one before. So high values of depth occur with low values of time, which is the book's second kind of clear direction.
Notice that you read the direction from the signs of the changes, not their sizes. The sizes are wildly different, 25 minutes at first and only 3 at the end, and that difference will matter in Part 4. For direction, all that counts is that every one of them points down.
In context: the deeper the dive, the shorter the maximum time a diver may stay down, ranging from 80 minutes at 50 feet to 22 minutes at 100 feet. That matches the physical reason, since more pressure means a diver's body absorbs gas faster.
Check every pair
Why: six depths make fifteen pairs; in every one the deeper dive allows less time.
\[ \binom{6}{2} = 15 \text{ pairs}, \quad 0 \text{ rise}, \; 15 \text{ fall} \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 624-625 — Try It 12.6 and Table 12.4
Intuition
The checks on the last few worked examples counted pairs. Here is why that is the honest way to read direction, and it needs no formulas at all.
Take any two points. If the one further right is also higher, that pair votes for a positive direction. If the one further right is lower, it votes negative. If they share an x value or a y value, the pair abstains.
\[ \text{rise: } (x_j - x_i)(y_j - y_i) > 0, \qquad \text{fall: } (x_j - x_i)(y_j - y_i) < 0 \]
The product is positive exactly when the two differences have the same sign, both up or both down, which is the book's high with high, low with low. It is negative when one goes up as the other goes down, which is high with low.
Vocabulary voted six to nothing, Amelia fifteen to nothing, the dives nothing to fifteen. Those are unanimous. Real data with any scatter are rarely unanimous, and the size of the majority tells you something about strength as well as direction. The next example counts a split vote.
\[ \text{number of pairs} = \binom{n}{2} = \frac{n(n - 1)}{2} \]
With eleven students there are 55 pairs, too many to read by eye, which is why a picture of all of them helps.
Worked example
Use the pair vote to state the direction of the exam data, and to see how clear that direction is. With eleven students there are many pairs, so set up the count carefully.
Count the pairs
Why: every two students make one pair.
\[ \binom{11}{2} = \frac{11 \times 10}{2} = 55 \]
Count the ties
Why: students sharing a third exam score, or a final score, cannot vote.
\[ \text{same } x: 3 + 1 + 1 = 5, \quad \text{same } y: 2, \quad \text{ties} = 7 \]
Count the rising pairs
Why: the better third exam also has the better final.
\[ \text{rise} = 38 \]
Count the falling pairs
Why: the better third exam has the worse final.
\[ \text{fall} = 10 \]
Figure (svg): The third exam scatter plot with a line segment joining every one of the 55 pairs of points. 38 segments rise and are green, 10 fall and are red, and 7 are grey dashed because the two points share an x value or a y value.
Compare
Why: a clear majority rising.
\[ \frac{38}{38 + 10} = \frac{38}{48} \approx 0.79 \]
In context: in about 79 percent of the pairs of students that can be compared, the one who did better on the third exam also did better on the final. The direction is positive. But one comparable pair in five goes the other way, so a good third exam makes a good final likely, not certain.
The ties are worth a sentence too. The three students at 71 make three tied pairs among themselves: they share an x value, so they say nothing about direction, though they say a lot about scatter.
Check the total
Why: rising, falling and tied pairs must account for all 55.
\[ 38 + 10 + 7 = 55 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 623-624 — Example 12.6 data
Sorting
For each pair of variables, predict the direction you would expect a scatter plot to show, before any data are collected. Think about what happens to the second variable as the first gets larger.
Sort into buckets
Sort each pair of variables by the direction you would expect its scatter plot to show.
Predicting the direction before plotting is a check on both you and the data. When the plot disagrees with a sensible prediction, look first for a data-entry error, such as columns swapped or a value typed with an extra zero, and only then for a surprising finding.
Heating bill and temperature is the one that catches people: you might expect bills to rise with something. They do rise, but with cold, so with temperature itself the direction is negative.
Error analysis
Asked for the direction of Example 12.6's exam data, a first attempt reads only the lowest and highest third exam scores and writes this. The conclusion happens to be right here; the method is what is wrong.
Annotate
On: \( (65, 175) \to (75, 198): \; 198 > 175 \;\Rightarrow\; \text{strong positive} \)
The danger is clearest in a different data set. Swap the first student's final from 175 to 120 and the two-end method still says positive, while the rest of the cloud is unchanged. Or keep the ends and scramble the middle: the two-end method cannot notice. It is reading two students, not the relationship.
The rule is that direction and strength are properties of the whole cloud. Any method that looks at fewer points than the plot shows is throwing evidence away.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 623-624 — Example 12.6
Trap
Comparing Amelia's plot with the dive plot, a first attempt says:
\[ \text{Amelia: positive} \;\Rightarrow\; \text{strong} \]
\[ \text{dives: negative} \;\Rightarrow\; \text{weak} \]
Wrong. Direction and strength are separate readings.
Direction says which way the cloud runs. Strength says how tightly it runs. A falling cloud can be just as tight as a rising one.
All fifteen dive pairs fall, a unanimous vote. Previewing Section 12.4's coefficient:
\[ r_{\text{dive}} = -0.96 \]
\[ r_{\text{Amelia}} = 1.00 \]
The sign records direction; how close the size is to one records strength. Both are strong.
Say each reading in its own sentence: deeper dives allow less time, and they do so very consistently.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 622 — direction and strength
Section
Part 3
Concept
The book's definition of strength is a visual one. You determine it by looking at the scatter plot and seeing how close the points are to a line, a power function, an exponential function, or some other type of function.
Figure (svg): Three scatter-plot panels without scales, all rising from left to right. Left: six points almost on a line, labelled strong. Middle: eight points in a wider band, labelled moderate. Right: ten points spread so widely that the rise is hard to see, labelled weak. Their correlations, computed from the plotted points, are 1.00, 0.81 and 0.39.
Imagine the best line you could draw through each cloud, and then a band around it just wide enough to hold every point. On the left the band is a thin ribbon: knowing x tells you y almost exactly. In the middle it is wider. On the right it is so wide that you would struggle to say which way the line should run.
The small numbers under each panel are a preview of Section 12.4's correlation coefficient, computed from the plotted points. You do not need them yet; they are there so you can calibrate your eye. A cloud that looks like the left panel will have a correlation near one, and one like the right panel a correlation well below it.
Notice the phrase or some other type of function. A relationship can be strong without being straight: points lying tightly along a curve are strongly related. Chapter 12 cares most about straight lines, so Part 4 will separate how strong a relationship is from what shape it has.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 622 — you can determine the strength of the relationship
Worked example
The exam data rose, but loosely. Measure how loosely, using only what the plot shows: the students who share a third exam score. If x alone determined y, students with the same x would have the same y.
The plan is to look at each vertical column of points and find how far apart its final scores are. That spread is variation that the third exam score cannot explain, because those students are identical on x.
Column at 67
Why: two students, finals 133 and 153.
\[ 153 - 133 = 20 \text{ points} \]
Column at 69
Why: two students, finals 151 and 159.
\[ 159 - 151 = 8 \text{ points} \]
Column at 71
Why: three students, finals 159, 163 and 185.
\[ 185 - 159 = 26 \text{ points} \]
Compare with the whole range
Why: the finals as a group run from 126 to 198.
\[ 198 - 126 = 72 \text{ points} \]
Figure (svg): The third exam scatter plot with three vertical yellow bands. At 67 the band spans final scores 133 to 153, a gap of 20. At 69 it spans 151 to 159, a gap of 8. At 71 it spans 159 to 185, a gap of 26.
In context: students who scored exactly 71 on the third exam finished as much as 26 points apart on the final, out of 200. The whole class spans 72 points, so the third exam narrows the likely final score but leaves a lot of it unexplained. That is a moderate relationship, not a strong one.
Compare Amelia: no two of her games share an x value, and every game sits within about half a point of a straight line through the others. That is what strong looks like.
Check against the preview coefficient
Why: Section 12.4's coefficient for these eleven students should be clearly below Amelia's.
\[ r_{\text{exam}} = 0.6631 \quad \text{vs} \quad r_{\text{Amelia}} = 0.9976 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 623-624 — Example 12.6
Trap
To show that the exam relationship is strong, a first attempt redraws the plot with the final score axis running from 0 to 400:
\[ 0 \le y \le 400 \]
The cloud becomes a thin flat streak, so the report says:
\[ \text{tight band} \Rightarrow \text{strong} \]
Wrong. The data did not change; only the window did.
Figure (svg): Two panels of the same eleven exam points. Left: the vertical axis runs from 0 to 400, so the points are squeezed into a thin flat strip and look tightly packed. Right: the vertical axis runs from 120 to 205, so the same points fill the panel and look loosely scattered.
Stretching an axis squeezes every cloud into a ribbon. Strength is a property of the data, so judge it on a window that just fits the points, the one ZoomStat would choose.
The coefficient cannot be fooled this way: it measures the scatter relative to each variable's own spread.
\[ r = 0.6631 \text{ in both panels} \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 621 — ZoomStat fits the window to the data
Ranking
You have now seen four real data sets from this chapter. Rank them from the strongest relationship to the weakest, judging only by how closely each cloud follows a straight line. Direction does not matter for this ranking.
Put in order
Order the data sets from strongest to weakest linear relationship.
Why: Amelia's six games sit within about half a point of a line. The dives fall unanimously but bend, so they stray a few minutes from any straight line. The exam cloud has columns 26 points tall. Phone digits have no relationship to shoe size at all.
The preview coefficients agree with the eye: 0.998 for Amelia, -0.963 for the dives, 0.663 for the exams, and close to zero for the phone digits. The dives' minus sign is direction; ignore it when ranking strength.
The dives sit second for an interesting reason. Their vote was unanimous, every pair falling, yet they are not as close to a straight line as Amelia's games because the pattern curves. A unanimous direction is not the same as a straight line. Part 4 takes that apart.
Concept
The book adds one exception to the rule that closer to a line means stronger, and it is the kind of thing that sounds like a trick until you see it. Consider a scatter plot where all the points fall on a horizontal line, providing a perfect fit.
Figure (svg): A scatter plot with x from 0 to 5 and y from 0 to 10. Four points at (1, 7), (2, 7), (3, 7) and (4, 7) lie exactly on a dashed horizontal line at y equals 7, labelled perfect fit, no relationship.
By the closeness rule this is the strongest possible plot: every point is exactly on the line. Now ask what the line says. A horizontal line has slope zero, so it says y is seven whatever x is.
\[ y = 7 + 0x \]
That is the definition of no relationship: changing x makes no difference to y. Knowing x tells you nothing you did not already know, since you would predict seven anyway. So the horizontal line in fact shows no relationship, exactly as the book says.
Strength, then, is really about how much of the variation in y the line accounts for. When y does not vary at all, there is nothing to account for, and the question of strength does not even arise. The next worked example shows the arithmetic agreeing with this picture.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 622-623 — the horizontal line would in fact show no relationship
Worked example
Suppose four measurements give the pairs (1, 7), (2, 7), (3, 7) and (4, 7). Show that x tells you nothing about y here, and see what goes wrong if you try to measure the strength of the relationship.
Strength compares how much y varies with how much of that variation follows x. So the first thing to compute is how much y varies at all, using the sample standard deviation from Chapter 2.
The mean of y
Why: add the four values and divide by four.
\[ \bar y = \frac{7 + 7 + 7 + 7}{4} = 7 \]
The deviations from the mean
Why: each y minus seven.
\[ y_i - \bar y = 0, \; 0, \; 0, \; 0 \]
The standard deviation of y
Why: square, add, divide by n minus one, take the root.
\[ s_y = \sqrt{\frac{0^2 + 0^2 + 0^2 + 0^2}{3}} = 0 \]
What the line predicts
Why: slope zero, so the prediction ignores x.
\[ \hat y = 7 + 0x = 7 \text{ for every } x \]
Section 12.4's correlation divides by the standard deviation of y. With that equal to zero, the correlation is not small, it is undefined: a division by zero. The arithmetic refuses to call this relationship strong, which agrees with the picture.
\[ r = \frac{\ldots}{(n - 1)\, s_x \, s_y} = \frac{\ldots}{0} \]
In context: if every measurement comes out 7 regardless of x, there is no variation in y for x to explain, so there is no relationship to describe.
Check with a prediction
Why: predict y at x = 1 and at x = 4 using x; then predict with no knowledge of x at all.
\[ \hat y(1) = 7, \quad \hat y(4) = 7, \quad \text{without } x: \; \bar y = 7 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 622-623 — the horizontal-line exception
Tweak it
Here is a line through the centre of the horizontal example, at x equal to 2.5 and y equal to 7, with its slope b on a slider. Predict first: at which slope does knowing x stop being useful?
Parameter explorer
Slide b from negative 2 to 2. At b = 1, how much does y change when x goes from 1 to 4? At b = 0, how much? What does a slope of zero say about whether x helps predict y?
\[ y = 7 + ({b})(x - 2.5) \]
What to notice: as b shrinks toward zero from either side, the line flattens, and the change in y across the data shrinks with it. At b equal to zero the change is nothing. A steep positive or negative slope means x matters; a flat line means it does not.
That is the exception in one movement of a slider. Points can sit perfectly on the line at every slope, including zero. Only a non-zero slope turns a perfect fit into a relationship. So when a plot looks perfectly tight, check the tilt before you call it strong.
A vertical stack is the mirror case: if every point had the same x, there would be no variation in x to explain anything with, and you could not study the relationship at all.
Counterexample
Here is a rule that sounds reasonable: the closer the points lie to a single straight line, the stronger the relationship between x and y. The book gives one exception. Find another situation where the rule fails or cannot be applied.
Discussion prompt
Describe a scatter plot whose points lie exactly on a straight line, yet which shows no relationship between x and y, or which cannot show one at all. Explain why.
Both counterexamples share one cause: one of the variables does not vary. A relationship is about how two variations line up, so if either variable is constant there is nothing to line up.
The useful habit is to check that both columns of a data set actually vary before you read strength. A study in which everyone got the same dose, or a gauge that was stuck at one reading, can produce a perfectly tight plot that means nothing.
Section
Part 4
Concept
The book's instruction for reading any scatter plot has two halves: when you look at a scatterplot, notice the overall pattern and any deviations from the pattern.
Figure (svg): A scatter plot panel without scales. Six points rise almost on a straight line from lower left to upper right; a seventh point sits far above them at the upper left and is ringed in red. With the ringed point the correlation of the plotted points is 0.63; without it, 1.00.
The pattern is the shape the bulk of the points follow: a straight line, a curve, or nothing at all. It decides which model is right. The deviations are individual points that do not follow it. They decide which observations need a closer look.
The two must be kept apart because they call for different responses. In this figure six points follow a straight line and one sits far above them. The pattern is still linear, and one point does not change that. But look at what that one point does to the preview coefficient: it falls from 1.00 to 0.63.
So a single deviation can make a strong linear pattern look moderate if you read only a number. The plot shows you why; the number does not. That is the deepest reason the book puts this section before any arithmetic.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 622 — Figure 12.6, a linear pattern with one deviation
Concept
Chapter 12 fits straight lines, so the most important pattern question is whether the cloud is straight. Figure 12.8 shows the alternative the book names first: exponential growth.
Figure (svg): A scatter plot of a bacteria count against hours, 0 to 5. The counts 100, 200, 400, 800, 1600 and 3200 lie on a curve that is nearly flat at first and then shoots up. A dashed straight line drawn through the cloud runs above the first two points, below the middle three and below the last. The correlation of the six points is 0.906.
A straight line adds the same amount for each step in x. A doubling pattern multiplies by the same amount. Look at the bacteria counts, one per hour.
\[ 100, \; 200, \; 400, \; 800, \; 1600, \; 3200 \]
The differences, 100, 200, 400, 800 and 1600, are not constant; they keep growing. The ratios, 200 over 100, 400 over 200 and so on, are all exactly two. Constant differences mean a straight line. Constant ratios mean exponential growth, which curves upward.
Here is the warning. The preview coefficient for these six points is 0.906, which sounds strong. The relationship is strong: it is perfectly regular. It just is not straight, and the dashed line misses in a systematic way. A large correlation never proves a pattern is linear; only the plot can show that.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 622-623 — a power function, an exponential function; Figure 12.8
Worked example
A culture of bacteria is counted every hour: 100, 200, 400, 800, 1600 and 3200. Decide from the numbers alone whether the scatter plot of count against hours is a straight line or a curve.
A straight line rises by the same amount at every step of equal width. So compute the step-by-step rises; if they are equal, the pattern is straight, and if they grow or shrink steadily, it curves.
Rise from hour 0 to hour 1
Why: next count minus this count.
\[ 200 - 100 = 100 \]
The remaining rises
Why: the same subtraction for each later hour.
\[ 400 - 200 = 200, \; 800 - 400 = 400, \; 1600 - 800 = 800, \; 3200 - 1600 = 1600 \]
Compare the rises
Why: each is double the one before, so they are not constant.
\[ 100, \; 200, \; 400, \; 800, \; 1600 \quad \text{(not constant)} \]
Compute the ratios instead
Why: each count divided by the one before.
\[ \frac{200}{100} = \frac{400}{200} = \frac{800}{400} = \frac{1600}{800} = \frac{3200}{1600} = 2 \]
Why ratios? Doubling is a multiplication, so the natural question is what you multiply by, not what you add. When a list of rises keeps growing in proportion to the values themselves, the ratio test is the one that comes out constant.
In context: the count doubles every hour, so the pattern is exponential growth, a strong positive relationship that curves upward. A straight line through it would under-predict the last hour badly and over-predict the first.
Check against a straight line
Why: the best straight line through the six points misses them with a sign pattern: above at both ends, below in the middle.
\[ \text{misses: } +486, \; +11, \; -363, \; -537, \; -311, \; +714 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 623 — Figure 12.8, exponential growth pattern
Worked example
The dive data fell at every step, a unanimous negative direction. Is the pattern straight? Use the same test as the bacteria: compare the drops between equally spaced depths.
The depths are spaced every 10 feet, so a straight-line pattern would lose the same number of minutes at every step. Write down the drops and see whether they are equal.
The first drop
Why: from 50 to 60 feet.
\[ 55 - 80 = -25 \text{ minutes} \]
The middle drops
Why: 60 to 70, 70 to 80, 80 to 90 feet.
\[ 45 - 55 = -10, \quad 35 - 45 = -10, \quad 25 - 35 = -10 \]
The last drop
Why: from 90 to 100 feet.
\[ 22 - 25 = -3 \text{ minutes} \]
Compare
Why: large at the start, small at the end.
\[ -25, \; -10, \; -10, \; -10, \; -3 \]
Figure (svg): The dive scatter plot with a straight line falling through the six points. Vertical segments join each point to the line: the points at 50 and 100 feet lie above the line, shown green, and the four in between lie below it, shown red.
In context: the maximum dive time falls fast between 50 and 60 feet and only slowly between 90 and 100 feet. The middle of the data is straight, but the ends are not: the pattern flattens as depth increases, a curve rather than a line.
Physically that makes sense. A time limit cannot fall below zero, so a falling limit has to level off somewhere; a straight line that kept dropping 11 minutes every 10 feet would soon promise negative time. The shrinking drops are the data showing you the floor.
Check with the line's misses
Why: if the bend is real, a straight line will miss above at both ends and below in the middle, not at random.
\[ +8.48, \; -5.38, \; -4.24, \; -3.10, \; -1.95, \; +6.19 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 624-625 — Try It 12.6
Worked example
The vocabulary rises in Part 1 were 443, then 682.5, then 732 words per year. Are those close enough to call the pattern straight, or is it bending upward? Apply both tests, differences and ratios, and then ask how much four points can say.
The ages are not equally spaced, 3, 4, 6 and 7, so compare rises per year rather than raw differences. A straight pattern gives equal rises per year; an exponential one gives equal ratios per year.
Rises per year
Why: from Part 1.
\[ 443, \quad 682.5, \quad 732 \text{ words per year} \]
Ratios per year
Why: the step from 4 to 6 covers two years, so take its square root.
\[ \frac{1098}{655} = 1.676, \quad \sqrt{\frac{2463}{1098}} = 1.498, \quad \frac{3195}{2463} = 1.297 \]
Compare
Why: neither list is constant.
\[ \text{rises grow}, \quad \text{ratios shrink} \]
So the pattern lies between the two models: the rises grow, so it bends upward a little, but far less than a doubling pattern would. A straight line is a reasonable first summary, with a slight upward curve worth watching.
Find the straight line's misses
Why: using the line a calculator fits, words equal to 644.5 times age minus 1369.75.
\[ 655 - 563.75 = +91.25, \quad 1098 - 1208.25 = -110.25 \]
\[ 2463 - 2497.25 = -34.25, \quad 3195 - 3141.75 = +53.25 \]
In context: vocabulary grows by roughly 640 words a year between ages 3 and 7 in this sample, perhaps a little faster at the older end. With only four children no one can tell a gentle bend from chance: the misses are about a hundred words, a few percent of the vocabularies.
Check the misses' pattern
Why: plus at both ends, minus in the middle, the same signature as the dives, but with four points it could easily be chance.
\[ +, \; -, \; -, \; + \quad \text{(4 points: too few to call)} \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 620 — Example 12.5
Worked example
Suppose the researcher in Example 12.5 adds a fifth child: age 5, with a vocabulary of 400 words. Decide whether this point changes the pattern or is a deviation from it.
The test: does the new point disturb the shape the other points follow, or does it sit alone? Find where the pattern of the original four puts a five-year-old, then measure how far off the new child is.
Locate age 5 on the pattern
Why: it lies halfway between the children aged 4 and 6.
\[ \frac{1098 + 2463}{2} = \frac{3561}{2} = 1780.5 \text{ words} \]
Measure the miss
Why: observed minus expected.
\[ 400 - 1780.5 = -1380.5 \text{ words} \]
Compare with the pattern's own misses
Why: the four original children fit their best line within about 110 words.
\[ |{-1380.5}| \gg 110 \]
Figure (svg): The vocabulary scatter plot with a fifth point at age 5 and 400 words, ringed in red, far below the other four. A dashed segment joins the points at age 4 and age 6, passing through 1780.5 at age 5, marked with a hollow yellow circle.
In context: the four original children still follow a clear rising pattern, and the new child sits far below it. One point is not a bend; it is a deviation. A bend would show as several points drifting off in a consistent direction.
What the deviation calls for is a closer look at that child. A typing slip is possible, though 4000 typed as 400 would have sat far above the pattern, not below. A real child with a language delay is real data: keep the point, and report it.
Look at what it does to the summaries. The preview coefficient falls from 0.997 to 0.841, all because of one child, while the other four children are exactly where they were.
Check with the pair vote
Why: five children make ten pairs; if the new child is a lone deviation, every falling pair must involve that child.
\[ \text{rise } 8, \; \text{fall } 2: \quad (3, 655)\text{ with }(5, 400), \; (4, 1098)\text{ with }(5, 400) \]
Anomaly
Suppose Amelia adds a seventh week: she practised 20 hours, far more than ever before, and scored 30 points. Her six earlier games rose about three points per extra hour. Predict what this one game does.
Predict first
With the seventh game included, what happens to the straight line that best fits Amelia's data?
Correct: It becomes much flatter, tilting toward the new point
Why: The six-game pattern predicts about 60 points at 20 hours, so the new game is about 30 points below it, and it sits far to the right of every other game. A point far out in x pulls the line strongly toward itself, so the slope drops from about three points per hour to under one.
Figure (svg): Amelia's six games plus a seventh at 20 hours and 30 points, ringed in red, far to the right of the others. A dashed line through the original six rises about 3 points per hour and reaches about 60 at 20 hours. A solid line fitted to all seven is much flatter, rising only about 0.9 points per hour.
\[ b: \; 2.97 \to 0.90 \text{ points per hour}, \qquad r: \; 0.998 \to 0.606 \]
The anomaly is how much one point matters. In the deviant-child example on the previous slide, the odd child sat at age 5, the middle of the ages, and the line's slope did not move at all: it is 644.5 words per year with or without that child. Here the odd game sits at the far end of x, and the slope collapses. Position in x is leverage.
Which reading is right? Possibly neither line. Twenty hours might be past the point where more practice helps, a bend; or she might have been ill that week, a deviation. The plot cannot decide, but it can tell you that this one point is deciding the answer, and that is worth knowing before anyone quotes the slope.
Picture it
The last panel in Figure 12.8 shows the case that ends the analysis early: no pattern. Here it is beside a weak pattern, so you can see the difference between a little and nothing.
Figure (svg): A scatter plot panel without scales. Fourteen points spread across the whole panel with no rise, no fall and no curve. The correlation of the plotted points is -0.03. Beside it, for comparison, a second small panel shows nine points drifting downward loosely, a weak negative pattern.
On the left there is no direction, no curve and no band. Pick any x and the y values above it span the whole range. Knowing x does not narrow down y at all, so there is nothing for a line to describe.
On the right the cloud is just as wide in places, but it drifts downward from left to right: the high-x points are mostly low, and the low-x points mostly high. That is a weak negative pattern. A line would describe it roughly, with large misses.
The hard part, with real data, is the border between the two. Section 12.4 makes that border precise with a hypothesis test: is the correlation significantly different from zero? For now, the honest description of a cloud like the left panel is simply that the plot shows no pattern.
The preview coefficients, -0.03 and -0.79, are computed from the plotted points. Even a patternless cloud rarely gives exactly zero, because random scatter always tilts a little one way or the other.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 623 — Figure 12.8, no pattern
Matching
Each reading of a scatter plot leads to a different next step. Match them. The point of this slide is that reading the plot is not an end in itself: it decides what you do next.
Match the pairs
Why: A straight pattern with a reason for x to explain y is what a regression line is for. A curve needs a curved model. A lone deviation needs investigating before anything is fitted. A horizontal line and a shapeless cloud both say that x does not help with y.
Two readings lead to the same conclusion by different routes. A horizontal line is perfectly tidy and a shapeless cloud is perfectly messy, but both say that x is no help with y.
The curved case is the one most often mishandled, because a curve can still produce a large correlation. A straight line fitted to it would be wrong in a predictable way, as the dive example showed.
Trap
Fitting a straight line to the dive data, a first attempt notices the two end points miss and decides:
\[ \text{drop } (50, 80) \text{ and } (100, 22) \]
The four remaining points lie on a perfect line.
\[ -10, \; -10, \; -10 \]
Wrong. That deletes the evidence of the bend.
A deviation is one point off on its own. A bend shows up as misses that follow a pattern: here, above at both ends and below in the middle.
\[ +8.48, \; -5.38, \; -4.24 \]
\[ -3.10, \; -1.95, \; +6.19 \]
Six misses in three blocks is systematic. The right response is a curved model, or a line used only over the middle depths, not trimmed data.
Deleting points to rescue a model is reporting the model, not the data. Delete only a point shown to be an error.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 624-625 — Try It 12.6
Fill the middle
A savings account's balance is recorded at the start of each year: 1000, 1050, 1102.50 and 1157.63 dollars. Fill in the differences and the ratio, then decide which pattern the scatter plot of balance against year would show.
Fill in the blanks
1050 - 1000 = 50, \quad 1102.50 - 1050 = 52.50, \quad \frac1.05___ = \frac______ = ___
Why: The differences, 50 and then 52.50, grow a little each year, while the ratios are exactly 1.05. Constant ratios mean exponential growth: the account earns five percent on a growing balance.
Here the growth is only five percent a year, so over four years the curve is very gentle. A scatter plot of these four points would look almost perfectly straight, and a line through them would fit well.
That is a real point about patterns: a gentle curve over a short range can look straight. Over thirty years the same account would curve unmistakably upward. Which is why the range of the data matters, and why a line that fits well inside the data can fail badly outside it, the subject of the next part.
Section
Part 5
Concept
The section ends with the condition for going further. If the points show a linear relationship, we would like to draw a line on the scatter plot, calculated by a process called linear regression. However, the book says, we only calculate a regression line if one of the variables helps to explain or predict the other.
\[ x \text{ helps explain or predict } y \;\Longrightarrow\; \text{fit } \hat y = a + bx \]
Read the two halves of that condition separately. The plot must show a linear pattern, which you check by looking. And there must be a reason to use x for y, which you check by thinking about the variables. Neither check can be done by the other.
The line is then used one way round: if x is the independent variable and y the dependent variable, the regression line predicts y for a given value of x. Not the reverse. A line that predicts the final exam from the third is not the line for predicting the third from the final.
Why insist on this when software will fit a line to any two columns of numbers? Because the line will come out looking authoritative whether or not it means anything. A line between two variables that merely happen to move together invites predictions, and decisions, that the data do not support.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 623 — we only calculate a regression line if one of the variables helps to explain or predict the other
Notation
The book's closing paragraph names the object the whole chapter builds toward. It is the same y = a + bx you met in Section 12.1, with one new mark and a set of conditions attached. Decode it before Section 12.3 computes it.
Annotate
On: \( \hat y = a + bx, \qquad \min x \le x \le \max x \)
Each annotation is one of this section's checks written into the formula. The hat says the points will miss; the straight form says the pattern must be straight; the x on the right says x must be the variable that explains or predicts; the range says stay inside the data.
Section 12.3 will choose a and b to make the misses as small as possible. Nothing in that calculation checks any of the four conditions above. That is why they belong to this section, and why they are done by looking.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, p. 623 — use a regression line to predict y for a given value of x
Picture it
The classic way the condition fails is a lurking variable: a third quantity that pushes both of your variables in the same direction. Shoe size and reading score among children aged six to twelve make the standard example.
Figure (svg): Left: a diagram with a box labelled age and arrows from it to two boxes, shoe size and reading score, which are joined only by a dashed line labelled linked only through age. Right: a scatter plot of 24 simulated children, shoe size from 9 to 20 across and reading score from 50 to 140 up, rising clearly, with a correlation of 0.91. The dots are coloured by age group, youngest blue, middle purple, oldest orange, and the colours run from lower left to upper right.
The scatter plot on the right is a simulation of 24 children, and it shows a clear positive relationship, with a preview coefficient of 0.91. A regression line would fit it and would predict reading scores from shoe size with respectable accuracy.
But the colours give the game away. The young children, in blue, have small feet and low scores; the older children, in orange, have big feet and high scores. Age drives both. Shoe size does not help explain reading at all; it is only a stand-in for age.
So the condition fails, even though the plot passes every visual test. The fix is to ask what the regression line would be for. If the honest answer is that nobody would ever change a child's shoe size to change reading, then shoe size does not explain reading, and you should look for the variable that does.
Discrimination
Each pair of variables shows a strong straight-line pattern in its scatter plot. Decide whether the book's condition is met: does one variable genuinely help explain or predict the other?
Sort into buckets
Sort each strongly correlated pair by whether a regression line of the second variable on the first is worth calculating.
The third exam is a useful in-between case. It does not cause the final score; both reflect how well a student knows the material. But it comes first in time and is genuinely informative, so using it to predict the final is legitimate. Prediction does not require cause; it requires that x be available first and carry real information about y.
What the lurking-variable cases have in common is that the useful variable is missing from the data. Temperature, age and population size would each make a far better x.
Worked example
Example 12.6 asks whether you can predict the final exam score of a random student if you know the third exam score. Before Section 12.3's line, answer it with nothing but group averages, which is what a line will later smooth.
Split the eleven students by third exam score into a low, a middle and a high group, and average the finals in each. If the third exam predicts the final, the group averages should climb.
Low group: third exam 65 to 67
Why: four students, finals 175, 126, 133, 153.
\[ \frac{175 + 126 + 133 + 153}{4} = \frac{587}{4} = 146.75 \]
Middle group: third exam 69 to 70
Why: three students, finals 151, 159, 163.
\[ \frac{151 + 159 + 163}{3} = \frac{473}{3} \approx 157.67 \]
High group: third exam 71 to 75
Why: four students, finals 185, 163, 159, 198.
\[ \frac{185 + 163 + 159 + 198}{4} = \frac{705}{4} = 176.25 \]
Compare the low and high groups
Why: the difference in average final score.
\[ 176.25 - 146.75 = 29.5 \text{ points} \]
In context: students who scored 71 or more on the third exam averaged about 30 more points on the final, out of 200, than students who scored 67 or less. So yes, the third exam helps predict the final. But within each group the finals still spread widely; the low group alone runs from 126 to 175.
This is the condition at work. The third exam comes first, and it is genuinely informative about the final, so a regression line of the final on the third exam is worth calculating. Section 12.3 does it.
Check the groups cover everyone
Why: four plus three plus four students, and the group totals add to the class total.
\[ 587 + 473 + 705 = 1765 \]
\[ 175 + 133 + 185 + 163 + 126 + 198 = 980 \]
\[ 153 + 163 + 159 + 151 + 159 = 785, \quad 980 + 785 = 1765 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 623-624 — Example 12.6: can you predict the final exam score?
Socratic
The book's condition says one variable must help explain or predict the other. Those are not the same thing, and the difference decides several of the cases you have sorted.
Discussion prompt
The third exam score does not cause the final exam score, yet the book treats it as a fine x for predicting the final. Shoe size does not cause reading score either, yet it is a poor x. What is the difference between the two cases?
So prediction is legitimate when x carries information about y that you could actually use, in the population you care about. Explanation is the stronger claim: that changing x would change y. A scatter plot can support the first; it can never establish the second by itself.
A good test: imagine using the line to act. Advising students with low third exam scores to study harder before the final is sensible. Buying children bigger shoes to improve their reading is absurd. The absurd action exposes the bad x.
Worked example
Try It 12.6 asks you to find the least-squares line for the dive data and predict the maximum dive time at 110 feet. Section 12.3 shows how to compute the line; here, take the line a calculator gives and look at what the scatter plot says about trusting it.
The calculator's line
Why: intercept and slope, to two decimals.
\[ \hat y = 127.24 - 1.11x \]
Substitute x = 110
Why: multiply the slope by 110 first.
\[ \hat y = 127.24 - 1.11(110) \]
Evaluate
Why: with the unrounded slope and intercept.
\[ \hat y = 127.24 - 122.57 = 4.67 \text{ minutes} \]
Figure (svg): The dive scatter plot with the straight line fitted to it extended from 50 to 125 feet. The line reaches 4.67 minutes at 110 feet, marked with a red dot, crosses zero at about 114 feet, and is negative beyond. The region beyond 100 feet, outside the data, is shaded.
Follow the line further
Why: the same line at 120 feet.
\[ \hat y(120) = 127.24 - 133.71 = -6.48 \text{ minutes} \]
A negative maximum dive time is impossible, so the line must be wrong out there. The scatter plot told you so in advance: the drops were shrinking, 25, then 10, then 3 minutes, so the real limits flatten out with depth, while the line keeps falling at about 11 minutes per 10 feet.
In context: the straight line predicts under 5 minutes at 110 feet, but 110 feet lies outside the depths in the table and the pattern was bending. The data suggest a limit nearer 20 minutes than 5. Predicting outside the observed range is extrapolation, which Section 12.3 warns against.
Check where the line runs out
Why: set the prediction to zero and solve for depth.
\[ 0 = 127.24 - 1.11x \;\Rightarrow\; x = \frac{127.24}{1.11} \approx 114.2 \text{ feet} \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.3, pp. 624-625 — Try It 12.6
Estimation
Ignore the straight line for a moment and use only the pattern of the points. The drops in maximum time between depths were 25, 10, 10, 10 and 3 minutes, ending at 22 minutes at 100 feet.
Predict first
Following the bending pattern of the points rather than the straight line, which estimate of the maximum dive time at 110 feet is most believable?
Correct: About 20 minutes
Why: The drops have been shrinking, and the last one was only 3 minutes, so the next 10 feet should cost a few minutes at most, putting the limit somewhat under 22. Five minutes is what the straight line says, because it keeps falling at the steep average rate of the shallow dives.
This is an estimate, not a calculation, and it is only as good as the assumption that the bend continues. Common recreational dive tables give a limit of about 16 minutes at 110 feet, much closer to the pattern's answer than to the line's.
The lesson is not that eyeballing beats regression. It is that a line is a summary of the points it was fitted to, over the range they cover. The plot tells you both the range and the shape, so the plot tells you where the line can be trusted.
Worked example
Example 12.5 put age across and vocabulary up. What changes if you plot it the other way round, words across and age up? Compare the two plots and the two lines a calculator would fit.
The plan is to compare strength, which depends on the cloud, with the lines, which depend on which variable is being predicted. Mirroring the plot swaps the roles of the variables.
Line predicting words from age
Why: slope in words per year.
\[ \hat y = -1369.75 + 644.5x \]
Line predicting age from words
Why: slope in years per word.
\[ \widehat{\text{age}} = 2.142 + 0.001552 \times \text{words} \]
Invert the first slope
Why: if the lines were the same line, this would match the second slope.
\[ \frac{1}{644.5} = 0.001552 \ne 0.001552 \]
Figure (svg): Two scatter-plot panels of the vocabulary data. Left: age across and words up, with a line rising 644.5 words per year. Right: words across and age up, with a line rising 0.00155 years per word. Both clouds hug their lines equally tightly.
In context: the two lines are close here, because these four points lie very nearly on one line, but they are not the same line. With looser data, such as the exam scores, the two lines differ a lot. Each one minimises misses in its own vertical direction.
The strength, on the other hand, is identical. The cloud is the same set of points, mirrored, and mirroring does not make a band any wider. The preview coefficient is the same both ways.
Check that strength is unchanged
Why: compute the coefficient both ways round.
\[ r(\text{age}, \text{words}) = r(\text{words}, \text{age}) = 0.9971 \]
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 620, 623 — x = child's age; a regression line predicts y for a given x
Real world
Published scatter plots are everywhere: income against life expectancy by country, hours of screen time against sleep, advertising spending against sales. The three readings from this section plus the fitting condition are a complete way to read any of them.
Discussion prompt
A health article shows a scatter plot of 50 cities: average daily coffee consumption per person across, and the rate of a certain heart condition up. The cloud rises clearly. Write four sentences: the direction, the strength and shape you would look for, what a deviation might mean here, and whether coffee consumption explains the heart condition.
Notice the unit of the data. Each point is a city, not a person. A relationship between city averages need not hold for individuals inside them; that is a separate trap, and one more reason to read the axes before the cloud.
A strong answer separates the two kinds of claim: what the plot shows, which is a pattern, and what it cannot show by itself, which is a reason. The book's condition for fitting a line lives exactly at that boundary.
Comparison
Here are the four real data sets of this section, read with the four questions. Fill in the blanks from what you have worked out.
Comparison matrix
| data set | direction | strength | pattern | x explains y? |
|---|---|---|---|---|
| age and vocabulary | positive | strong | straight, slight upward bend | yes |
| practice and points | positive | very strong | straight | yes |
| third and final exam | positive | moderate | straight, wide band | predicts (comes first) |
| depth and dive time | negative | strong | curved | yes |
Read the table by columns. Three of the four are positive; only the dives fall. Strength ranges from Amelia's very tight line to the exam scores' wide band. The pattern column is where the dives stand out: a strong, unanimous direction that still is not a straight line.
The last column is the one no plot fills in for you. Each entry there came from thinking about what the variables are, not from the dots.
Notice too that strength and pattern are filled in independently. The dives are strong and curved; the exams are straight and only moderate. Neither column predicts the other, which is why the book asks for both, and why one correlation number, which mixes them, is never a full description.
Section
Part 6
Pattern
Every example in this section ran through the same sequence. The order matters: each step assumes the ones before it.
Figure (svg): A flow diagram of six boxes left to right in two rows. Top row: choose x and y; plot every pair; read the direction. Bottom row: judge the strength; read the pattern and the deviations; decide whether x explains y, which leads to fitting a line or to stopping.
Notice that steps 3 to 5 are all read from the same picture, in a fixed order: which way, how tightly, what shape. Saying them as three separate sentences is the surest way not to blur them together, as in the trap that called a negative relationship weak.
Most wrong readings skip a step: they call a negative relationship weak, read direction from two points, judge strength on a stretched axis, trim a bend as bad points, or fit a line to two variables that only share a cause. Each has its own check, and the diagram puts each check where it belongs.
Check
Read direction and strength separately, then look at the options.
Picture the cloud first: which way does it run as x increases, and how wide is the band around it?
Check your understanding
A scatter plot of 30 used cars shows age in years across and price up. The points fall from the upper left to the lower right and stay within a narrow band around a straight line. Which description is correct?
Answer: A
Why: Falling from upper left to lower right means older cars sell for less, high with low, so the direction is negative. A narrow band around a straight line means the relationship is strong. Direction and strength are separate readings.
In context: knowing a car's age tells you its price fairly precisely, and the older it is the less it sells for. The commonest wrong answer treats the word negative as a judgement of quality. It is only a direction.
The quick test: say the direction in words, older cars cheaper, and then say the strength in words, close to a line. If both sentences are true, the description is right.
Would you fit a line here? Age plausibly explains price, since cars lose value as they get older, and the pattern is straight, so yes, at least over the ages in the data. Beyond them, prices level off rather than fall below zero, the same floor the dive limits showed.
Check
Ask what the line would predict before judging the fit.
A perfect fit is not the same as a strong relationship. Decide what a horizontal line says about x.
Check your understanding
A researcher records the dose of a supplement and a blood measurement for eight patients. Every patient's blood measurement comes out at exactly 50, whatever the dose, so the points lie exactly on a horizontal line. What does the scatter plot show?
Answer: A
Why: A horizontal line says the blood measurement is 50 whatever the dose, so changing the dose makes no difference to it. That is no relationship, the book's exception: a perfect fit to a horizontal line. The standard deviation of the measurement is zero, so the correlation is undefined.
In context: in this data set, the dose had no detectable effect on the measurement. That might be the real finding, or a sign that the measuring device was stuck. Either way it is not a strong relationship.
The tilt test from the slider settles questions like this: a perfect fit means a strong relationship only when the line has a non-zero slope.
It is also a reminder to look at the data before trusting software. Asked for a correlation here, a calculator returns an error, a division by zero, rather than a number. The plot explains the error in a glance: the measurement never varied.
Check
Look at the pattern first, then at the variables.
Both halves of the condition have to hold: a straight pattern, and a reason for x to explain y.
Check your understanding
A plot of a company's sales against years since founding shows every point lying tightly along a curve that bends upward more and more steeply, with no point out of line. What is the right response?
Answer: A
Why: The points follow an upward-bending curve, like the bacteria counts, so the relationship is strong and positive but not linear. A straight line would miss in a systematic pattern and badly under-predict the most recent years.
In context: the company's sales are growing at an accelerating rate, and a model that bends with them, such as an exponential, would describe them; a straight line would not.
A quick test is the one from the bacteria and the savings account: compare differences between equally spaced years. Growing differences mean the line will fail at the ends.
Notice that the variables pass the other half of the condition: years since founding plausibly help predict sales. It is the shape that fails. Both halves have to hold, and either one alone can stop you fitting a straight line.
Explain it to yourself
The horizontal-line exception is short to state and easy to forget. Explaining it in your own words is the best test of whether the idea of strength has landed.
Discussion prompt
In two or three sentences, explain why points lying perfectly on a horizontal line show no relationship, even though they fit the line perfectly. Use the idea of predicting y from x.
A strong answer separates two ideas that the word fit runs together: how close the points are to a line, and whether the line says that y depends on x. A very strong one adds the arithmetic: the standard deviation of y is zero.
The same reasoning explains why a nearly horizontal tight band is a weak relationship even though it looks tidy: the line through it barely tilts, so x changes the prediction very little.
Exit ticket
A sleep researcher records, for six volunteers, the hours slept the night before and the reaction time next morning, in milliseconds: (4, 410), (5, 365), (6, 330), (7, 305), (8, 290) and (9, 285).
Discussion prompt
Without fitting anything, describe the scatter plot: state its direction, judge its strength, say whether the pattern is straight or curved using the drops between neighbouring points, and say whether a straight regression line would be a good model.
This is the dive data's pattern in a new setting: a unanimous direction, a strong relationship, and a bend that only the differences reveal. If you said strong and negative and stopped there, you read two of the three things the book asks for.
If you suggested fitting a straight line and predicting for 12 hours of sleep, look at what the line would say: reaction time keeps falling forever. Outside the data, the shape matters most.
Recap
A scatter plot shows two variables measured on the same individuals, one point per individual, with the explaining variable across and the responding variable up. It is how you look at a relationship before calculating anything.
| reading | what to look for | the check |
|---|---|---|
| direction | climbing: positive, high with high; falling: negative, high with low | count the pair vote, not two end points |
| strength | how close the points lie to a line or curve | a window that fits the data; columns at one x |
| exception | all points on a horizontal line: perfect fit, no relationship | s_y = 0, so r is undefined |
| pattern | straight, curved, or none | constant differences mean straight; constant ratios mean exponential |
| deviations | single points away from the pattern | a lone point: investigate; misses in blocks: a bend |
| fit a line? | only if x helps explain or predict y | watch for a lurking variable; never beyond the data |
Four real data sets carried the section. Vocabulary and age, positive and strong with a hint of bend. Amelia's practice and points, positive and very strong. The exam scores, positive and moderate, with columns of scatter at a single x. The dive limits, negative, strong and curved, and dangerous to extrapolate.
The arithmetic was light: rises, drops, ratios and a count of pairs. What carried the weight was judgement, and that judgement decides whether the regression line of Section 12.3 and the correlation test of Section 12.4 mean anything at all.
The Introductory Business Statistics text opens its regression chapter with the same pictures, in business settings, if you want more scatter plots to read. Next, Section 12.3 finds the line that fits a straight cloud best.
OpenStax Introductory Statistics 2e, §12.2 Scatter Plots §12.2, pp. 620-623 — the whole section
OpenStax Introductory Business Statistics 2e, §13.1 The Correlation Coefficient r §13.1 The Correlation Coefficient r — scatter plots and the strength of a linear relationship in business contexts
Want this taught 1-on-1? Alexander tutors Statistics — $55/session, free consultation.