#set document(title: "8.8 Scatter Plots, Correlation, and Regression Lines", author: "OpenStax / XYZ Homework") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 8.8#h(0.6em)Scatter Plots, Correlation, and Regression Lines #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 21.25pt), (230.00pt, 129.62pt), stroke: 0.7pt + black) content((111.16pt, 83.58pt), anchor: "south", text(size: 9pt)[best fit]) circle((46.00pt, 21.25pt), radius: 3.0pt, fill: black, stroke: none) circle((92.00pt, 42.50pt), radius: 3.0pt, fill: black, stroke: none) circle((138.00pt, 63.75pt), radius: 3.0pt, fill: black, stroke: none) circle((184.00pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((207.00pt, 106.25pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[20]) line((46.00pt, 0.00pt), (46.00pt, -3.00pt), stroke: 0.5pt + black) content((46.00pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((92.00pt, 0.00pt), (92.00pt, -3.00pt), stroke: 0.5pt + black) content((92.00pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((138.00pt, 0.00pt), (138.00pt, -3.00pt), stroke: 0.5pt + black) content((138.00pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((184.00pt, 0.00pt), (184.00pt, -3.00pt), stroke: 0.5pt + black) content((184.00pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[120]) line((-3.00pt, 42.50pt), (0.00pt, 42.50pt), stroke: 0.5pt + black) content((-5.00pt, 42.50pt), anchor: "east", text(size: 8pt)[40]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 127.50pt), (0.00pt, 127.50pt), stroke: 0.5pt + black) content((-5.00pt, 127.50pt), anchor: "east", text(size: 8pt)[120]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[160]) })]), alt: "A scatter plot. The x-axis ranges from 20 to 120, in increments of 20. The y-axis ranges from 0 to 160, in increments of 40. The points are scattered along a line from 40 to 110 on the horizontal axis and 20 to 120 on the vertical axis. The line represents the best line of fit and it passes through the following points: (20, 20), (40, 40), (60, 60), (80, 80), (100, 100), and (120, 122). Note: all values are approximate.", caption: [A scatter plot is a visualization of the relationship between quantitative dataset.], ) === Learning Objectives After completing this section, you should be able to: + Construct a scatter plot for a dataset. + Interpret a scatter plot. + Distinguish among positive, negative and no correlation. + Compute the correlation coefficient. + Estimate and interpret regression lines. One of the most powerful tools statistics gives us is the ability to explore relationships between two datasets containing quantitative values, and then use that relationship to make predictions. For example, a student who wants to know how well they can expect to score on an upcoming final exam may consider reviewing the data on midterm and final exam scores for students who have previously taken the class. It seems reasonable to expect that there is a relationship between those two datasets: If a student did well on the midterm, they were probably more likely to do well on the final than the average student. Similarly, if a student did poorly on the midterm, they probably also did poorly on the final exam. Of course, that relationship isn’t set in stone; a student’s performance on a midterm exam doesn’t cement their performance on the final! A student might use a poor result on the midterm as motivation to study more for the final. A student with a really good grade on the midterm might be overconfident going into the final, and as a result doesn’t prepare adequately. The statistical method of #emph[regression] can find a formula that does the best job of predicting a score on the final exam based on the student’s score on the midterm, as well as give a measure of the confidence of that prediction! In this section, we’ll discover how to use regression to make these predictions. First, though, we need to lay some graphical groundwork. === Relationships Between Quantitative Datasets Before we can evaluate a relationship between two datasets, we must first decide if we feel that one might depend on the other. In our exam example, it is appropriate to say that the score on the final depends on the score on the midterm, rather than the other way around: if the midterm depended on the final, then we’d need to know the final score #emph[first], which doesn’t make sense. Here’s another example: if we collected data on home purchases in a certain area, and noted both the sale price of the house and the annual household income of the purchaser, we might expect a relationship between those two. Which depends on the other? In this case, sale price depends on income: people who have a higher income can afford a more expensive house. If it were the other way around, people could buy a new, more expensive house and then expect a raise! (This is very bad advice.) It's worth noting that not every pair of related datasets has clear dependence. For example, consider the percent of a country’s budget devoted to the military and the percent earmarked for public health. These datasets are generally related: as one goes up, the other goes down. However, in this case, there’s not a preferred choice for dependence, as each could be seen as depending on the other. When exploring the relationship between two datasets, if one set seems to depend on the other, we’ll say that dataset contains values of the #strong[response variable] (or #strong[dependent variable]). The dataset that the response variable depends on contains values of what we call the #strong[explanatory variable] (or #strong[independent variable]). If no dependence relationship can be identified, then we can assign either dataset to either role. #examplebox("Example 1")[Identifying Explanatory and Response Variables][ For each of the following pairs of related datasets, identify which (if any) should be assigned the role of response variable and which should be assigned to be the explanatory variable. + A person’s height and weight + A professional basketball player’s salary and their average points scored per game (which is a measure of how good they are at basketball) + The length and width of leaves on a tree #solutionbox[ + As people get taller, their weight tends to increase. But if a person goes on a diet and loses weight, we don’t expect them to also get shorter. So, weight depends on height. That means we’ll say that the response variable is #emph[weight] and the explanatory variable is #emph[height]. + The more points a basketball player scores, the more money they should make. But if a basketball player gets a raise, we wouldn’t expect them to get better at basketball as a result. So, the response is #emph[salary] and the explanatory is #emph[points per game]. + The way that the length and width of leaves are connected isn’t clear. It seems reasonable that as the width goes up, so would the length. But the other direction is also plausible: as the length goes up, so does the width. Without a clear dependence relationship, we’re free to declare either to be the response and the other to be the explanatory. ] ] Once we’ve assigned roles to our two datasets, we can take the first step in visualizing the relationship between them: creating a scatter plot. ==== Creating Scatter Plots A #strong[scatter plot] is a visualization of the relationship between two quantitative sets of data. The scatter plot is created by turning the datasets into ordered pairs: the first coordinate contains data values from the explanatory dataset, and the second coordinate contains the #emph[corresponding] data values from the response dataset. These ordered pairs are then plotted in the #math.equation(block: false, alt: "xy")[$italic("xy")$]-plane. Let's return to our exam example to put this into practice. #examplebox("Example 2")[Creating Scatter Plots Without Technology][ Students are exploring the relationship between scores on the midterm exam and final exam in their math course. Here are some of the scores reported by their classmates: #figure(table( columns: 3, align: left, inset: 6pt, table.header([Name], [Midterm grade], [Final grade]), [Student 1], [88], [84], [Student 2], [71], [80], [Student 3], [75], [77], [Student 4], [94], [95], [Student 5], [68], [73], )) Create a scatter plot to visualize the data. #solutionbox[ #strong[Step 1:] Since it makes more sense to think of the final exam score as being dependent on the midterm exam score, we’ll let the final grade be the response. So, let’s think of these two datasets as a set of ordered pairs, midterm first, final second: #figure(table( columns: 2, align: left, inset: 6pt, table.header([Name], [(Midterm, Final)]), [Student 1], [(88, 84)], [Student 2], [(71, 80)], [Student 3], [(75, 77)], [Student 4], [(94, 95)], [Student 5], [(68, 73)], )) #strong[Step 2:] Next, let’s make the axes. On the horizontal axis, make sure the range of values is sufficient to cover all of the explanatory data. For our data, that’s 68 to 94. Similarly, the vertical axis should cover all of the response data (73 to 95): #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[65]) line((38.33pt, 0.00pt), (38.33pt, -3.00pt), stroke: 0.5pt + black) content((38.33pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[75]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[85]) line((191.67pt, 0.00pt), (191.67pt, -3.00pt), stroke: 0.5pt + black) content((191.67pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[95]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[70]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[75]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[85]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[90]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[95]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[100]) })]), alt: "A blank coordinate plane. The horizontal axis ranges from 65 to 95, in increments of 5. The vertical axis ranges from 70 to 100, in increments of 5.", caption: none, ) #strong[Step 3:] Our first point is (88, 84). So, we’ll locate 88 on the horizontal axis, 84 on the vertical axis, and identify the point that’s directly above the first location and horizontally level with the second: #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 79.33pt), (230.00pt, 79.33pt), stroke: (paint: black, thickness: 0.6pt, dash: "dotted")) line((176.33pt, 0.00pt), (176.33pt, 170.00pt), stroke: (paint: black, thickness: 0.6pt, dash: "dotted")) circle((176.33pt, 79.33pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[65]) line((38.33pt, 0.00pt), (38.33pt, -3.00pt), stroke: 0.5pt + black) content((38.33pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[75]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[85]) line((191.67pt, 0.00pt), (191.67pt, -3.00pt), stroke: 0.5pt + black) content((191.67pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[95]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[70]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[75]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[85]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[90]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[95]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[100]) })]), alt: "A coordinate plane plots a point. The horizontal axis ranges from 65 to 95, in increments of 5. The vertical axis ranges from 70 to 100, in increments of 5. A horizontal dotted line is drawn at 84. A vertical dotted line is drawn at 88. The two dotted lines intersect at the point (88, 84).", caption: none, ) #strong[Step 4:] Repeat this process to place the other four points on the graph: #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((23.00pt, 17.00pt), radius: 3.0pt, fill: black, stroke: none) circle((53.67pt, 56.67pt), radius: 3.0pt, fill: black, stroke: none) circle((76.67pt, 39.67pt), radius: 3.0pt, fill: black, stroke: none) circle((176.33pt, 79.33pt), radius: 3.0pt, fill: black, stroke: none) circle((222.33pt, 141.67pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[65]) line((38.33pt, 0.00pt), (38.33pt, -3.00pt), stroke: 0.5pt + black) content((38.33pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[75]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[85]) line((191.67pt, 0.00pt), (191.67pt, -3.00pt), stroke: 0.5pt + black) content((191.67pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[95]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[70]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[75]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[85]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[90]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[95]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[100]) })]), alt: "Five points are plotted on a coordinate plane. The horizontal axis ranges from 65 to 95, in increments of 5. The vertical axis ranges from 70 to 100, in increments of 5. The points are as follows: (68, 73), (72, 80), (75, 77), (88, 84), and (94, 95). Note: all values are approximate.", caption: none, ) #strong[Step 5:] Finally, label the axes: #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((23.00pt, 17.00pt), radius: 3.0pt, fill: black, stroke: none) circle((53.67pt, 56.67pt), radius: 3.0pt, fill: black, stroke: none) circle((76.67pt, 39.67pt), radius: 3.0pt, fill: black, stroke: none) circle((176.33pt, 79.33pt), radius: 3.0pt, fill: black, stroke: none) circle((222.33pt, 141.67pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[65]) line((38.33pt, 0.00pt), (38.33pt, -3.00pt), stroke: 0.5pt + black) content((38.33pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[75]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[85]) line((191.67pt, 0.00pt), (191.67pt, -3.00pt), stroke: 0.5pt + black) content((191.67pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[95]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[70]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[75]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[85]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[90]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[95]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[100]) content((115.00pt, -19.00pt), anchor: "north", text(font: sys.inputs.at("title-font", default: "STIX Two Text"), size: 9pt)[midterm]) content((-32.00pt, 85.00pt), angle: 90deg, anchor: "south", text(font: sys.inputs.at("title-font", default: "STIX Two Text"), size: 9pt)[final]) })]), alt: "Five points are plotted on a coordinate plane. The horizontal axis representing midterm ranges from 65 to 95, in increments of 5. The vertical axis representing final ranges from 70 to 100, in increments of 5. The points are as follows: (68, 73), (72, 80), (75, 77), (88, 84), and (94, 95). Note: all values are approximate.", caption: none, ) ] ] For large datasets, it’s impractical to create scatter plots manually. Luckily, Google Sheets automates this process for us. #notebox("Video", rgb("#DC2626"), rgb("#DC2626"), rgb("#f7f8fa"))[ #link("https://openstax.org/r/Scatter-Plots")[Making Scatter Plots in Google Sheets] ] #examplebox("Example 3")[Creating Scatter Plots in Google Sheets][ The dataset #link("https://openstax.org/r/Chapter8_Data-Sets")[“NHL19”] gives the results of the 2018–2019 National Hockey League season. The columns are team, wins (W), losses (L), overtime losses (OTL), total points (PTS), goals scored by the team (GF), goals scored against the team (GA), and goal differential (the difference in GF and GA). Use Google Sheets to create a scatter plot for GF vs. GA. #notebox("Checkpoint", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ When we talk about plotting one set versus another, the first is the response and the second is explanatory. ] #solutionbox[ #strong[Step 1:] Open the dataset in Google Sheets, and click and drag to select the data we want to visualize (in this case, we want the columns for GF and GA; make sure you include those labels in the selection). #strong[Step 2:] Next, click on the “Insert” menu, then click “Chart.” Sheets will automatically choose a chart format; if the result isn’t a scatter plot, click on the drop-down menu under “Chart type” in the Chart Editor on the right side of the window and select “Scatter chart.” #strong[Step 3:] Next, check that the correct choices were made for the horizontal and vertical axes. In this case, we want to see GF on the vertical axis and GA on the horizontal axis. If Sheets made the wrong choice, we can fix it in the Chart Editor by clicking on the name of the dataset under “X-axis” to open up a dropdown menu, then selecting the variable that should go on the horizontal axis (GA in this case). #strong[Step 4:] Now, click on the variable under “Series” and select the one that should go on the vertical axis (GF). If you had to make that change, the axis labels in the graph may also need changing; those labels can be fixed using the “Customize” tab in the Chart Editor under “Chart & axis titles.” Your result should look like this: #figure( stdfig([#cetz.canvas({ import cetz.draw: * content((115.00pt, 192.00pt), text(font: sys.inputs.at("title-font", default: "STIX Two Text"), size: 11pt)[GF versus GA]) circle((32.86pt, 12.14pt), radius: 3.0pt, fill: black, stroke: none) circle((65.71pt, 24.29pt), radius: 3.0pt, fill: black, stroke: none) circle((98.57pt, 36.43pt), radius: 3.0pt, fill: black, stroke: none) circle((131.43pt, 48.57pt), radius: 3.0pt, fill: black, stroke: none) circle((164.29pt, 60.71pt), radius: 3.0pt, fill: black, stroke: none) circle((197.14pt, 72.86pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[180]) line((32.86pt, 0.00pt), (32.86pt, -3.00pt), stroke: 0.5pt + black) content((32.86pt, -5.00pt), anchor: "north", text(size: 8pt)[200]) line((65.71pt, 0.00pt), (65.71pt, -3.00pt), stroke: 0.5pt + black) content((65.71pt, -5.00pt), anchor: "north", text(size: 8pt)[220]) line((98.57pt, 0.00pt), (98.57pt, -3.00pt), stroke: 0.5pt + black) content((98.57pt, -5.00pt), anchor: "north", text(size: 8pt)[240]) line((131.43pt, 0.00pt), (131.43pt, -3.00pt), stroke: 0.5pt + black) content((131.43pt, -5.00pt), anchor: "north", text(size: 8pt)[260]) line((164.29pt, 0.00pt), (164.29pt, -3.00pt), stroke: 0.5pt + black) content((164.29pt, -5.00pt), anchor: "north", text(size: 8pt)[280]) line((197.14pt, 0.00pt), (197.14pt, -3.00pt), stroke: 0.5pt + black) content((197.14pt, -5.00pt), anchor: "north", text(size: 8pt)[300]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[320]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[190]) line((-3.00pt, 24.29pt), (0.00pt, 24.29pt), stroke: 0.5pt + black) content((-5.00pt, 24.29pt), anchor: "east", text(size: 8pt)[210]) line((-3.00pt, 48.57pt), (0.00pt, 48.57pt), stroke: 0.5pt + black) content((-5.00pt, 48.57pt), anchor: "east", text(size: 8pt)[230]) line((-3.00pt, 72.86pt), (0.00pt, 72.86pt), stroke: 0.5pt + black) content((-5.00pt, 72.86pt), anchor: "east", text(size: 8pt)[250]) line((-3.00pt, 97.14pt), (0.00pt, 97.14pt), stroke: 0.5pt + black) content((-5.00pt, 97.14pt), anchor: "east", text(size: 8pt)[270]) line((-3.00pt, 121.43pt), (0.00pt, 121.43pt), stroke: 0.5pt + black) content((-5.00pt, 121.43pt), anchor: "east", text(size: 8pt)[290]) line((-3.00pt, 145.71pt), (0.00pt, 145.71pt), stroke: 0.5pt + black) content((-5.00pt, 145.71pt), anchor: "east", text(size: 8pt)[310]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[330]) content((115.00pt, -19.00pt), anchor: "north", text(font: sys.inputs.at("title-font", default: "STIX Two Text"), size: 9pt)[GA]) content((-32.00pt, 85.00pt), angle: 90deg, anchor: "south", text(font: sys.inputs.at("title-font", default: "STIX Two Text"), size: 9pt)[GF]) })]), alt: "A scatter plot titled, GF versus GA. The horizontal axis representing GA ranges from 180 to 320, in increments of 20. The vertical axis representing GF ranges from 190 to 330, in increments of 20. The points are scattered throughout and it lies from 200 to 300 on the horizontal axis and 200 to 290 on the vertical axis.", caption: [(data source: www.nhl.com)], ) ] ] ==== Reading and Interpreting Scatter Plots Scatter plots give us information about the existence and strength of a relationship between two datasets. To break that information down, there are a series of questions we might ask to help us. First: Is there a curved pattern in the data? If the answer is “yes,” then we can stop; none of the linear regression techniques from here to the end of this section are appropriate. and show several examples of scatter plots that can help us identify these curved patterns. #figure( stdfig([#cetz.canvas({ import cetz.draw: * merge-path(stroke: (paint: rgb("#D62128"), thickness: 0.9pt), fill: none, { line((0.00pt, 53.83pt), (0.81pt, 53.49pt)) line((0.81pt, 53.49pt), (1.77pt, 53.07pt)) line((1.77pt, 53.07pt), (2.89pt, 52.59pt)) line((2.89pt, 52.59pt), (4.13pt, 52.05pt)) line((4.13pt, 52.05pt), (5.49pt, 51.47pt)) line((5.49pt, 51.47pt), (6.94pt, 50.84pt)) line((6.94pt, 50.84pt), (8.47pt, 50.18pt)) line((8.47pt, 50.18pt), (10.06pt, 49.49pt)) line((10.06pt, 49.49pt), (11.70pt, 48.79pt)) line((11.70pt, 48.79pt), (13.36pt, 48.07pt)) line((13.36pt, 48.07pt), (15.04pt, 47.35pt)) line((15.04pt, 47.35pt), (16.71pt, 46.63pt)) line((16.71pt, 46.63pt), (18.36pt, 45.92pt)) line((18.36pt, 45.92pt), (19.97pt, 45.22pt)) line((19.97pt, 45.22pt), (21.52pt, 44.55pt)) line((21.52pt, 44.55pt), (23.00pt, 43.92pt)) line((23.00pt, 43.92pt), (24.44pt, 43.29pt)) line((24.44pt, 43.29pt), (25.87pt, 42.65pt)) line((25.87pt, 42.65pt), (27.31pt, 42.00pt)) line((27.31pt, 42.00pt), (28.75pt, 41.34pt)) line((28.75pt, 41.34pt), (30.19pt, 40.68pt)) line((30.19pt, 40.68pt), (31.62pt, 40.01pt)) line((31.62pt, 40.01pt), (33.06pt, 39.35pt)) line((33.06pt, 39.35pt), (34.50pt, 38.69pt)) line((34.50pt, 38.69pt), (35.94pt, 38.04pt)) line((35.94pt, 38.04pt), (37.38pt, 37.41pt)) line((37.38pt, 37.41pt), (38.81pt, 36.79pt)) line((38.81pt, 36.79pt), (40.25pt, 36.18pt)) line((40.25pt, 36.18pt), (41.69pt, 35.60pt)) line((41.69pt, 35.60pt), (43.12pt, 35.04pt)) line((43.12pt, 35.04pt), (44.56pt, 34.50pt)) line((44.56pt, 34.50pt), (46.00pt, 34.00pt)) line((46.00pt, 34.00pt), (47.44pt, 33.50pt)) line((47.44pt, 33.50pt), (48.87pt, 32.99pt)) line((48.87pt, 32.99pt), (50.31pt, 32.47pt)) line((50.31pt, 32.47pt), (51.75pt, 31.95pt)) line((51.75pt, 31.95pt), (53.19pt, 31.44pt)) line((53.19pt, 31.44pt), (54.62pt, 30.94pt)) line((54.62pt, 30.94pt), (56.06pt, 30.46pt)) line((56.06pt, 30.46pt), (57.50pt, 30.02pt)) line((57.50pt, 30.02pt), (58.94pt, 29.60pt)) line((58.94pt, 29.60pt), (60.37pt, 29.23pt)) line((60.37pt, 29.23pt), (61.81pt, 28.92pt)) line((61.81pt, 28.92pt), (63.25pt, 28.65pt)) line((63.25pt, 28.65pt), (64.69pt, 28.46pt)) line((64.69pt, 28.46pt), (66.12pt, 28.33pt)) line((66.12pt, 28.33pt), (67.56pt, 28.29pt)) line((67.56pt, 28.29pt), (69.00pt, 28.33pt)) line((69.00pt, 28.33pt), (70.44pt, 28.47pt)) line((70.44pt, 28.47pt), (71.88pt, 28.70pt)) line((71.88pt, 28.70pt), (73.31pt, 29.01pt)) line((73.31pt, 29.01pt), (74.75pt, 29.40pt)) line((74.75pt, 29.40pt), (76.19pt, 29.85pt)) line((76.19pt, 29.85pt), (77.62pt, 30.36pt)) line((77.62pt, 30.36pt), (79.06pt, 30.92pt)) line((79.06pt, 30.92pt), (80.50pt, 31.52pt)) line((80.50pt, 31.52pt), (81.94pt, 32.16pt)) line((81.94pt, 32.16pt), (83.38pt, 32.82pt)) line((83.38pt, 32.82pt), (84.81pt, 33.49pt)) line((84.81pt, 33.49pt), (86.25pt, 34.18pt)) line((86.25pt, 34.18pt), (87.69pt, 34.86pt)) line((87.69pt, 34.86pt), (89.12pt, 35.54pt)) line((89.12pt, 35.54pt), (90.56pt, 36.20pt)) line((90.56pt, 36.20pt), (92.00pt, 36.83pt)) line((92.00pt, 36.83pt), (93.44pt, 37.47pt)) line((93.44pt, 37.47pt), (94.87pt, 38.13pt)) line((94.87pt, 38.13pt), (96.31pt, 38.82pt)) line((96.31pt, 38.82pt), (97.75pt, 39.53pt)) line((97.75pt, 39.53pt), (99.19pt, 40.26pt)) line((99.19pt, 40.26pt), (100.62pt, 41.00pt)) line((100.62pt, 41.00pt), (102.06pt, 41.75pt)) line((102.06pt, 41.75pt), (103.50pt, 42.50pt)) line((103.50pt, 42.50pt), (104.94pt, 43.25pt)) line((104.94pt, 43.25pt), (106.37pt, 44.00pt)) line((106.37pt, 44.00pt), (107.81pt, 44.74pt)) line((107.81pt, 44.74pt), (109.25pt, 45.47pt)) line((109.25pt, 45.47pt), (110.69pt, 46.18pt)) line((110.69pt, 46.18pt), (112.12pt, 46.87pt)) line((112.12pt, 46.87pt), (113.56pt, 47.53pt)) line((113.56pt, 47.53pt), (115.00pt, 48.17pt)) line((115.00pt, 48.17pt), (116.44pt, 48.75pt)) line((116.44pt, 48.75pt), (117.87pt, 49.29pt)) line((117.87pt, 49.29pt), (119.31pt, 49.77pt)) line((119.31pt, 49.77pt), (120.75pt, 50.23pt)) line((120.75pt, 50.23pt), (122.19pt, 50.65pt)) line((122.19pt, 50.65pt), (123.62pt, 51.06pt)) line((123.62pt, 51.06pt), (125.06pt, 51.47pt)) line((125.06pt, 51.47pt), (126.50pt, 51.89pt)) line((126.50pt, 51.89pt), (127.94pt, 52.32pt)) line((127.94pt, 52.32pt), (129.38pt, 52.77pt)) line((129.38pt, 52.77pt), (130.81pt, 53.27pt)) line((130.81pt, 53.27pt), (132.25pt, 53.81pt)) line((132.25pt, 53.81pt), (133.69pt, 54.41pt)) line((133.69pt, 54.41pt), (135.12pt, 55.08pt)) line((135.12pt, 55.08pt), (136.56pt, 55.83pt)) line((136.56pt, 55.83pt), (138.00pt, 56.67pt)) line((138.00pt, 56.67pt), (139.44pt, 57.59pt)) line((139.44pt, 57.59pt), (140.88pt, 58.58pt)) line((140.88pt, 58.58pt), (142.31pt, 59.64pt)) line((142.31pt, 59.64pt), (143.75pt, 60.76pt)) line((143.75pt, 60.76pt), (145.19pt, 61.93pt)) line((145.19pt, 61.93pt), (146.62pt, 63.15pt)) line((146.62pt, 63.15pt), (148.06pt, 64.41pt)) line((148.06pt, 64.41pt), (149.50pt, 65.70pt)) line((149.50pt, 65.70pt), (150.94pt, 67.02pt)) line((150.94pt, 67.02pt), (152.38pt, 68.36pt)) line((152.38pt, 68.36pt), (153.81pt, 69.71pt)) line((153.81pt, 69.71pt), (155.25pt, 71.08pt)) line((155.25pt, 71.08pt), (156.69pt, 72.44pt)) line((156.69pt, 72.44pt), (158.12pt, 73.81pt)) line((158.12pt, 73.81pt), (159.56pt, 75.16pt)) line((159.56pt, 75.16pt), (161.00pt, 76.50pt)) line((161.00pt, 76.50pt), (162.44pt, 77.83pt)) line((162.44pt, 77.83pt), (163.88pt, 79.16pt)) line((163.88pt, 79.16pt), (165.31pt, 80.49pt)) line((165.31pt, 80.49pt), (166.75pt, 81.83pt)) line((166.75pt, 81.83pt), (168.19pt, 83.18pt)) line((168.19pt, 83.18pt), (169.62pt, 84.54pt)) line((169.62pt, 84.54pt), (171.06pt, 85.92pt)) line((171.06pt, 85.92pt), (172.50pt, 87.30pt)) line((172.50pt, 87.30pt), (173.94pt, 88.71pt)) line((173.94pt, 88.71pt), (175.38pt, 90.13pt)) line((175.38pt, 90.13pt), (176.81pt, 91.57pt)) line((176.81pt, 91.57pt), (178.25pt, 93.04pt)) line((178.25pt, 93.04pt), (179.69pt, 94.53pt)) line((179.69pt, 94.53pt), (181.12pt, 96.04pt)) line((181.12pt, 96.04pt), (182.56pt, 97.59pt)) line((182.56pt, 97.59pt), (184.00pt, 99.17pt)) line((184.00pt, 99.17pt), (185.44pt, 100.76pt)) line((185.44pt, 100.76pt), (186.87pt, 102.34pt)) line((186.87pt, 102.34pt), (188.31pt, 103.93pt)) line((188.31pt, 103.93pt), (189.75pt, 105.52pt)) line((189.75pt, 105.52pt), (191.19pt, 107.13pt)) line((191.19pt, 107.13pt), (192.62pt, 108.75pt)) line((192.62pt, 108.75pt), (194.06pt, 110.41pt)) line((194.06pt, 110.41pt), (195.50pt, 112.09pt)) line((195.50pt, 112.09pt), (196.94pt, 113.82pt)) line((196.94pt, 113.82pt), (198.37pt, 115.59pt)) line((198.37pt, 115.59pt), (199.81pt, 117.41pt)) line((199.81pt, 117.41pt), (201.25pt, 119.29pt)) line((201.25pt, 119.29pt), (202.69pt, 121.23pt)) line((202.69pt, 121.23pt), (204.12pt, 123.24pt)) line((204.12pt, 123.24pt), (205.56pt, 125.33pt)) line((205.56pt, 125.33pt), (207.00pt, 127.50pt)) line((207.00pt, 127.50pt), (208.48pt, 129.84pt)) line((208.48pt, 129.84pt), (210.03pt, 132.43pt)) line((210.03pt, 132.43pt), (211.64pt, 135.20pt)) line((211.64pt, 135.20pt), (213.29pt, 138.12pt)) line((213.29pt, 138.12pt), (214.96pt, 141.16pt)) line((214.96pt, 141.16pt), (216.64pt, 144.27pt)) line((216.64pt, 144.27pt), (218.30pt, 147.40pt)) line((218.30pt, 147.40pt), (219.94pt, 150.52pt)) line((219.94pt, 150.52pt), (221.53pt, 153.59pt)) line((221.53pt, 153.59pt), (223.06pt, 156.55pt)) line((223.06pt, 156.55pt), (224.51pt, 159.38pt)) line((224.51pt, 159.38pt), (225.87pt, 162.03pt)) line((225.87pt, 162.03pt), (227.11pt, 164.46pt)) line((227.11pt, 164.46pt), (228.23pt, 166.62pt)) line((228.23pt, 166.62pt), (229.19pt, 168.49pt)) line((229.19pt, 168.49pt), (230.00pt, 170.00pt)) }) circle((0.00pt, 53.83pt), radius: 3.0pt, fill: black, stroke: none) circle((46.00pt, 34.00pt), radius: 3.0pt, fill: black, stroke: none) circle((69.00pt, 28.33pt), radius: 3.0pt, fill: black, stroke: none) circle((138.00pt, 56.67pt), radius: 3.0pt, fill: black, stroke: none) circle((184.00pt, 99.17pt), radius: 3.0pt, fill: black, stroke: none) circle((230.00pt, 170.00pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 28.33pt), (234.00pt, 28.33pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 28.33pt), (0.00pt, 25.33pt), stroke: 0.5pt + black) content((0.00pt, 23.33pt), anchor: "north", text(size: 8pt)[20]) line((46.00pt, 28.33pt), (46.00pt, 25.33pt), stroke: 0.5pt + black) content((46.00pt, 23.33pt), anchor: "north", text(size: 8pt)[40]) line((92.00pt, 28.33pt), (92.00pt, 25.33pt), stroke: 0.5pt + black) content((92.00pt, 23.33pt), anchor: "north", text(size: 8pt)[60]) line((138.00pt, 28.33pt), (138.00pt, 25.33pt), stroke: 0.5pt + black) content((138.00pt, 23.33pt), anchor: "north", text(size: 8pt)[80]) line((184.00pt, 28.33pt), (184.00pt, 25.33pt), stroke: 0.5pt + black) content((184.00pt, 23.33pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 28.33pt), (230.00pt, 25.33pt), stroke: 0.5pt + black) content((230.00pt, 23.33pt), anchor: "north", text(size: 8pt)[120]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[−100]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[300]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[400]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[500]) })]), alt: "A scatter plot represents a curved pattern. The x-axis ranges from 20 to 120, in increments of 20. The y-axis ranges from negative 100 to 500, in increments of 100. The scatter plot shows points scattered along a curve that passes through the following points: (20, 90), (40, 20), (50, 0), (80, 100), (100, 250), and (120, 500). Note: all values are approximate.", caption: [Curved pattern], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((0.00pt, 12.14pt), radius: 3.0pt, fill: black, stroke: none) circle((28.75pt, 36.43pt), radius: 3.0pt, fill: black, stroke: none) circle((57.50pt, 60.71pt), radius: 3.0pt, fill: black, stroke: none) circle((86.25pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((115.00pt, 109.29pt), radius: 3.0pt, fill: black, stroke: none) circle((143.75pt, 133.57pt), radius: 3.0pt, fill: black, stroke: none) circle((172.50pt, 121.43pt), radius: 3.0pt, fill: black, stroke: none) circle((201.25pt, 145.71pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 24.29pt), (0.00pt, 24.29pt), stroke: 0.5pt + black) content((-5.00pt, 24.29pt), anchor: "east", text(size: 8pt)[20]) line((-3.00pt, 48.57pt), (0.00pt, 48.57pt), stroke: 0.5pt + black) content((-5.00pt, 48.57pt), anchor: "east", text(size: 8pt)[40]) line((-3.00pt, 72.86pt), (0.00pt, 72.86pt), stroke: 0.5pt + black) content((-5.00pt, 72.86pt), anchor: "east", text(size: 8pt)[60]) line((-3.00pt, 97.14pt), (0.00pt, 97.14pt), stroke: 0.5pt + black) content((-5.00pt, 97.14pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 121.43pt), (0.00pt, 121.43pt), stroke: 0.5pt + black) content((-5.00pt, 121.43pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 145.71pt), (0.00pt, 145.71pt), stroke: 0.5pt + black) content((-5.00pt, 145.71pt), anchor: "east", text(size: 8pt)[120]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[140]) })]), alt: "A scatter plot represents no curved pattern. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 140, in increments of 20. The points are scattered throughout and it lies from 30 to 100 on the horizontal axis and 10 to 120 on the vertical axis.", caption: [No curved pattern], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * merge-path(stroke: 0.9pt + black, fill: none, { line((0.00pt, 85.00pt), (32.86pt, 42.50pt)) line((32.86pt, 42.50pt), (82.14pt, 21.25pt)) line((82.14pt, 21.25pt), (131.43pt, 53.12pt)) line((131.43pt, 53.12pt), (197.14pt, 131.75pt)) line((197.14pt, 131.75pt), (230.00pt, 148.75pt)) line((230.00pt, 148.75pt), (230.00pt, 138.12pt)) }) circle((0.00pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((32.86pt, 42.50pt), radius: 3.0pt, fill: black, stroke: none) circle((82.14pt, 21.25pt), radius: 3.0pt, fill: black, stroke: none) circle((131.43pt, 53.12pt), radius: 3.0pt, fill: black, stroke: none) circle((197.14pt, 131.75pt), radius: 3.0pt, fill: black, stroke: none) circle((230.00pt, 148.75pt), radius: 3.0pt, fill: black, stroke: none) circle((230.00pt, 138.12pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((32.86pt, 0.00pt), (32.86pt, -3.00pt), stroke: 0.5pt + black) content((32.86pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((65.71pt, 0.00pt), (65.71pt, -3.00pt), stroke: 0.5pt + black) content((65.71pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((98.57pt, 0.00pt), (98.57pt, -3.00pt), stroke: 0.5pt + black) content((98.57pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((131.43pt, 0.00pt), (131.43pt, -3.00pt), stroke: 0.5pt + black) content((131.43pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((164.29pt, 0.00pt), (164.29pt, -3.00pt), stroke: 0.5pt + black) content((164.29pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((197.14pt, 0.00pt), (197.14pt, -3.00pt), stroke: 0.5pt + black) content((197.14pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[40]) line((-3.00pt, 21.25pt), (0.00pt, 21.25pt), stroke: 0.5pt + black) content((-5.00pt, 21.25pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 42.50pt), (0.00pt, 42.50pt), stroke: 0.5pt + black) content((-5.00pt, 42.50pt), anchor: "east", text(size: 8pt)[60]) line((-3.00pt, 63.75pt), (0.00pt, 63.75pt), stroke: 0.5pt + black) content((-5.00pt, 63.75pt), anchor: "east", text(size: 8pt)[70]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-9.50pt, 85.00pt), anchor: "east", text(size: 8pt)[80]) line((-3.00pt, 106.25pt), (0.00pt, 106.25pt), stroke: 0.5pt + black) content((-5.00pt, 106.25pt), anchor: "east", text(size: 8pt)[90]) line((-3.00pt, 127.50pt), (0.00pt, 127.50pt), stroke: 0.5pt + black) content((-5.00pt, 127.50pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 148.75pt), (0.00pt, 148.75pt), stroke: 0.5pt + black) content((-5.00pt, 148.75pt), anchor: "east", text(size: 8pt)[110]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[120]) })]), alt: "A scatter plot represents a curved pattern. The x-axis ranges from 30 to 100, in increments of 10. The y-axis ranges from 40 to 120, in increments of 10. The scatter plot shows points scattered along a curve that passes through the following points: (30, 80), (40, 60), (55, 50), (70, 65), (90, 102), (100, 110), and (100, 105). Note: all values are approximate.", caption: [Curved pattern], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((14.38pt, 141.67pt), radius: 3.0pt, fill: black, stroke: none) circle((28.75pt, 124.67pt), radius: 3.0pt, fill: black, stroke: none) circle((57.50pt, 113.33pt), radius: 3.0pt, fill: black, stroke: none) circle((86.25pt, 99.17pt), radius: 3.0pt, fill: black, stroke: none) circle((115.00pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((143.75pt, 70.83pt), radius: 3.0pt, fill: black, stroke: none) circle((172.50pt, 42.50pt), radius: 3.0pt, fill: black, stroke: none) circle((201.25pt, 28.33pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[250]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[300]) })]), alt: "A scatter plot represents no curved pattern. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 300, in increments of 50. The points are scattered in linear decreasing order. Some of the points are as follows: (35, 250), (40, 220), (50, 200), (60, 175), (70, 150), (80, 125), (90, 75), and (100, 50). Note: all values are approximate.", caption: [No curved pattern], ) Once we have confirmed that there is no curved pattern in our data, we can move to the next question: Is there a linear relationship? To answer this, we must look at different values of the explanatory variable and determine whether the corresponding response values are different, #emph[on average]. It's important to look at the values “on average” because, in general, our scatter plots won’t include just one corresponding response point for each value of the explanatory variable (i.e., there may be multiple response values for each explanatory value). So, we try to look for the center of those points. Let’s look again at , but consider some different values for the explanatory variable. Let’s highlight the points whose #math.equation(block: false, alt: "x")[$x$]-values are around 50 and those that are around 80: #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((57.50pt, 164.33pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((51.75pt, 110.50pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((51.75pt, 113.33pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((56.06pt, 127.50pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((57.50pt, 115.03pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((138.00pt, 82.17pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((140.88pt, 73.67pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((143.75pt, 68.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((146.62pt, 68.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((146.62pt, 39.67pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((149.50pt, 51.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((150.94pt, 51.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((149.50pt, 56.67pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((149.50pt, 68.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[250]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[300]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 300, in increments of 50. The points are scattered in linear decreasing order. Some of the points are highlighted in red and the points are as follows: (50, 290), (48, 195), (48, 200), (49.5, 225), (50, 203), (78, 145), (79, 130), (80, 120), (81, 120), (81, 70), (82, 90), (82.5, 90), (82, 100), and (82, 120). Note: all values are approximate.", caption: none, ) Now, we can estimate the middle of each group of points. Let's add our estimated averages to the plot as starred points: #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((57.50pt, 164.33pt), radius: 3.0pt, fill: black, stroke: none) circle((51.75pt, 110.50pt), radius: 3.0pt, fill: black, stroke: none) circle((51.75pt, 113.33pt), radius: 3.0pt, fill: black, stroke: none) circle((56.06pt, 127.50pt), radius: 3.0pt, fill: black, stroke: none) circle((57.50pt, 115.03pt), radius: 3.0pt, fill: black, stroke: none) circle((138.00pt, 82.17pt), radius: 3.0pt, fill: black, stroke: none) circle((140.88pt, 73.67pt), radius: 3.0pt, fill: black, stroke: none) circle((143.75pt, 68.00pt), radius: 3.0pt, fill: black, stroke: none) circle((146.62pt, 68.00pt), radius: 3.0pt, fill: black, stroke: none) circle((146.62pt, 39.67pt), radius: 3.0pt, fill: black, stroke: none) circle((149.50pt, 51.00pt), radius: 3.0pt, fill: black, stroke: none) circle((150.94pt, 51.00pt), radius: 3.0pt, fill: black, stroke: none) circle((149.50pt, 56.67pt), radius: 3.0pt, fill: black, stroke: none) circle((149.50pt, 68.00pt), radius: 3.0pt, fill: black, stroke: none) circle((57.50pt, 113.33pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((143.75pt, 68.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 28.33pt), (0.00pt, 28.33pt), stroke: 0.5pt + black) content((-5.00pt, 28.33pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 56.67pt), (0.00pt, 56.67pt), stroke: 0.5pt + black) content((-5.00pt, 56.67pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 113.33pt), (0.00pt, 113.33pt), stroke: 0.5pt + black) content((-5.00pt, 113.33pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 141.67pt), (0.00pt, 141.67pt), stroke: 0.5pt + black) content((-5.00pt, 141.67pt), anchor: "east", text(size: 8pt)[250]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[300]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 300, in increments of 50. The points are scattered in linear decreasing order. Some of the points are highlighted in red and the points are as follows: (50, 290), (48, 195), (48, 200), (49.5, 225), (50, 203), (78, 145), (79, 130), (80, 120), (81, 120), (81, 70), (82, 90), (82.5, 90), (82, 100), and (82, 120). Asterisks are marked at (50, 200) and (80, 120). Note: all values are approximate.", caption: none, ) Since those two starred points occur at different heights, we can conclude that there’s likely a relationship worth exploring. Here’s another example using a different set of data: #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[250]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 250, in increments of 50. The points are scattered throughout and it lies from 30 to 105 on the horizontal axis and 50 to 250 on the vertical axis.", caption: none, ) Let’s look again at the points near 50 and near 80, and estimate the middles of those clusters: #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((51.75pt, 81.60pt), radius: 3.0pt, fill: black, stroke: none) circle((51.75pt, 95.20pt), radius: 3.0pt, fill: black, stroke: none) circle((57.50pt, 102.00pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) circle((57.50pt, 105.40pt), radius: 3.0pt, fill: black, stroke: none) circle((51.75pt, 129.20pt), radius: 3.0pt, fill: black, stroke: none) circle((60.38pt, 132.60pt), radius: 3.0pt, fill: black, stroke: none) circle((149.50pt, 51.00pt), radius: 3.0pt, fill: black, stroke: none) circle((143.75pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((146.62pt, 88.40pt), radius: 3.0pt, fill: black, stroke: none) circle((143.75pt, 108.80pt), radius: 3.0pt, fill: black, stroke: none) circle((146.62pt, 108.80pt), radius: 3.0pt, fill: black, stroke: none) circle((149.50pt, 95.20pt), radius: 3.0pt, fill: black, stroke: none) circle((146.62pt, 132.60pt), radius: 3.0pt, fill: black, stroke: none) circle((146.62pt, 136.00pt), radius: 3.0pt, fill: black, stroke: none) circle((138.00pt, 142.80pt), radius: 3.0pt, fill: black, stroke: none) circle((143.75pt, 115.60pt), radius: 3.0pt, fill: rgb("#D62128"), stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[250]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 250, in increments of 50. The points are scattered throughout and it lies from 30 to 105 on the horizontal axis and 50 to 250 on the vertical axis. Some of the points are marked in red: (48, 120), (48, 140), (50, 150), (50, 155), (48, 190), (51, 195), (82, 75), (80, 125), (81, 130), (80, 160), (81, 160), (82, 140), (81, 195), (81, 200), and (78, 210). Asterisks are marked at (50, 150) and (80, 170). Note all values are approximate.", caption: none, ) Notice that there’s not much vertical distance between our two starred points. This tells us that there’s not a strong relationship between these two datasets. ==== Positive and Negative Linear Relationships Another way to assess whether there is a relationship between two datasets in a scatter plot is to see if the points seem to be clustered around a line (specifically, a line that’s not horizontal). The stronger the clustering around that line is, the stronger the relationship. Once we’ve established that there’s a relationship worth exploring, it’s time to start quantifying that relationship. Two datasets have a #strong[positive linear relationship] if the values of the response tend to increase, on average, as the values of the explanatory variable increase. If the values of the response #emph[decrease] with increasing values of the explanatory variable, then there is a #strong[negative linear relationship] between the two datasets. The strength of the relationship is determined by how closely the scatter plot follows a single straight line: the closer the points are to that line, the stronger the relationship. The scatter plots in to depict varying strengths and directions of linear relationships. #figure( stdfig([#cetz.canvas({ import cetz.draw: * merge-path(stroke: 0.9pt + black, fill: none, { line((0.00pt, 170.00pt), (5.75pt, 165.75pt)) line((5.75pt, 165.75pt), (28.75pt, 148.75pt)) line((28.75pt, 148.75pt), (86.25pt, 106.25pt)) line((86.25pt, 106.25pt), (115.00pt, 85.00pt)) line((115.00pt, 85.00pt), (172.50pt, 42.50pt)) line((172.50pt, 42.50pt), (201.25pt, 21.25pt)) line((201.25pt, 21.25pt), (230.00pt, 0.00pt)) }) circle((5.75pt, 165.75pt), radius: 3.0pt, fill: black, stroke: none) circle((28.75pt, 148.75pt), radius: 3.0pt, fill: black, stroke: none) circle((86.25pt, 106.25pt), radius: 3.0pt, fill: black, stroke: none) circle((115.00pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((172.50pt, 42.50pt), radius: 3.0pt, fill: black, stroke: none) circle((201.25pt, 21.25pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[210]) line((-3.00pt, 21.25pt), (0.00pt, 21.25pt), stroke: 0.5pt + black) content((-5.00pt, 21.25pt), anchor: "east", text(size: 8pt)[220]) line((-3.00pt, 42.50pt), (0.00pt, 42.50pt), stroke: 0.5pt + black) content((-5.00pt, 42.50pt), anchor: "east", text(size: 8pt)[230]) line((-3.00pt, 63.75pt), (0.00pt, 63.75pt), stroke: 0.5pt + black) content((-5.00pt, 63.75pt), anchor: "east", text(size: 8pt)[240]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[250]) line((-3.00pt, 106.25pt), (0.00pt, 106.25pt), stroke: 0.5pt + black) content((-5.00pt, 106.25pt), anchor: "east", text(size: 8pt)[260]) line((-3.00pt, 127.50pt), (0.00pt, 127.50pt), stroke: 0.5pt + black) content((-5.00pt, 127.50pt), anchor: "east", text(size: 8pt)[270]) line((-3.00pt, 148.75pt), (0.00pt, 148.75pt), stroke: 0.5pt + black) content((-5.00pt, 148.75pt), anchor: "east", text(size: 8pt)[280]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[290]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 210 to 290, in increments of 10. The points are arranged in linear decreasing order in a single row. Some of the points are as follows: (32, 288), (40, 280), (60, 260), (70, 250), (90, 230), and (100, 220). Note: all values are approximate.", caption: [Perfect negative relationship], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((5.75pt, 147.90pt), radius: 3.0pt, fill: black, stroke: none) circle((28.75pt, 137.70pt), radius: 3.0pt, fill: black, stroke: none) circle((86.25pt, 102.00pt), radius: 3.0pt, fill: black, stroke: none) circle((115.00pt, 76.50pt), radius: 3.0pt, fill: black, stroke: none) circle((172.50pt, 51.00pt), radius: 3.0pt, fill: black, stroke: none) circle((201.25pt, 42.50pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[220]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[240]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[260]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[280]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[300]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 200 to 300, in increments of 20. The points are arranged in linear decreasing order in multiple rows. Some of the points are as follows: (32, 287), (40, 281), (60, 260), (70, 245), (90, 230), and (100, 225). Note: all values are approximate.", caption: [Strong negative relationship], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 42.50pt), (0.00pt, 42.50pt), stroke: 0.5pt + black) content((-5.00pt, 42.50pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[250]) line((-3.00pt, 127.50pt), (0.00pt, 127.50pt), stroke: 0.5pt + black) content((-5.00pt, 127.50pt), anchor: "east", text(size: 8pt)[300]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[350]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 150 to 350, in increments of 50. The points are scattered throughout. Most points lie from 30 to 100 on the horizontal axis and 200 to 300 on the vertical axis.", caption: [Weak negative relationship], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((28.75pt, 0.00pt), (28.75pt, -3.00pt), stroke: 0.5pt + black) content((28.75pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((86.25pt, 0.00pt), (86.25pt, -3.00pt), stroke: 0.5pt + black) content((86.25pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((115.00pt, 0.00pt), (115.00pt, -3.00pt), stroke: 0.5pt + black) content((115.00pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((143.75pt, 0.00pt), (143.75pt, -3.00pt), stroke: 0.5pt + black) content((143.75pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((201.25pt, 0.00pt), (201.25pt, -3.00pt), stroke: 0.5pt + black) content((201.25pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[50]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[100]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[150]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[200]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[250]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 110, in increments of 10. The y-axis ranges from 0 to 250, in increments of 50. The points are scattered throughout. Most points lie from 30 to 105 on the horizontal axis and 50 to 250 on the vertical axis.", caption: [No relationship], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[20]) line((25.56pt, 0.00pt), (25.56pt, -3.00pt), stroke: 0.5pt + black) content((25.56pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((51.11pt, 0.00pt), (51.11pt, -3.00pt), stroke: 0.5pt + black) content((51.11pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((102.22pt, 0.00pt), (102.22pt, -3.00pt), stroke: 0.5pt + black) content((102.22pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((127.78pt, 0.00pt), (127.78pt, -3.00pt), stroke: 0.5pt + black) content((127.78pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((178.89pt, 0.00pt), (178.89pt, -3.00pt), stroke: 0.5pt + black) content((178.89pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((204.44pt, 0.00pt), (204.44pt, -3.00pt), stroke: 0.5pt + black) content((204.44pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[300]) line((-3.00pt, 17.00pt), (0.00pt, 17.00pt), stroke: 0.5pt + black) content((-5.00pt, 17.00pt), anchor: "east", text(size: 8pt)[320]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[340]) line((-3.00pt, 51.00pt), (0.00pt, 51.00pt), stroke: 0.5pt + black) content((-5.00pt, 51.00pt), anchor: "east", text(size: 8pt)[360]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[380]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[400]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[420]) line((-3.00pt, 119.00pt), (0.00pt, 119.00pt), stroke: 0.5pt + black) content((-5.00pt, 119.00pt), anchor: "east", text(size: 8pt)[440]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[460]) line((-3.00pt, 153.00pt), (0.00pt, 153.00pt), stroke: 0.5pt + black) content((-5.00pt, 153.00pt), anchor: "east", text(size: 8pt)[480]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[500]) })]), alt: "A scatter plot. The x-axis ranges from 20 to 110, in increments of 10. The y-axis ranges from 300 to 500, in increments of 20. The points are scattered at the center of the graph. Most points lie from 50 to 90 on the horizontal axis and 340 to 440 on the vertical axis.", caption: [Weak positive relationship], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((17.89pt, 38.25pt), radius: 3.0pt, fill: black, stroke: none) circle((51.11pt, 51.00pt), radius: 3.0pt, fill: black, stroke: none) circle((102.22pt, 68.00pt), radius: 3.0pt, fill: black, stroke: none) circle((127.78pt, 76.50pt), radius: 3.0pt, fill: black, stroke: none) circle((153.33pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((204.44pt, 102.00pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[20]) line((25.56pt, 0.00pt), (25.56pt, -3.00pt), stroke: 0.5pt + black) content((25.56pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((51.11pt, 0.00pt), (51.11pt, -3.00pt), stroke: 0.5pt + black) content((51.11pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((102.22pt, 0.00pt), (102.22pt, -3.00pt), stroke: 0.5pt + black) content((102.22pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((127.78pt, 0.00pt), (127.78pt, -3.00pt), stroke: 0.5pt + black) content((127.78pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((178.89pt, 0.00pt), (178.89pt, -3.00pt), stroke: 0.5pt + black) content((178.89pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((204.44pt, 0.00pt), (204.44pt, -3.00pt), stroke: 0.5pt + black) content((204.44pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[300]) line((-3.00pt, 17.00pt), (0.00pt, 17.00pt), stroke: 0.5pt + black) content((-5.00pt, 17.00pt), anchor: "east", text(size: 8pt)[320]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[340]) line((-3.00pt, 51.00pt), (0.00pt, 51.00pt), stroke: 0.5pt + black) content((-5.00pt, 51.00pt), anchor: "east", text(size: 8pt)[360]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[380]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[400]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[420]) line((-3.00pt, 119.00pt), (0.00pt, 119.00pt), stroke: 0.5pt + black) content((-5.00pt, 119.00pt), anchor: "east", text(size: 8pt)[440]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[460]) line((-3.00pt, 153.00pt), (0.00pt, 153.00pt), stroke: 0.5pt + black) content((-5.00pt, 153.00pt), anchor: "east", text(size: 8pt)[480]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[500]) })]), alt: "A scatter plot. The x-axis ranges from 20 to 110, in increments of 10. The y-axis ranges from 300 to 500, in increments of 20. The points are scattered in linear increasing order in a single row. Some of the points are as follows: (27, 345), (40, 360), (60, 380), (70, 390), (80, 400), and (100, 420). Note: all values are approximate.", caption: [Strong positive relationship], ) #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((17.89pt, 38.25pt), radius: 3.0pt, fill: black, stroke: none) circle((51.11pt, 51.00pt), radius: 3.0pt, fill: black, stroke: none) circle((102.22pt, 68.00pt), radius: 3.0pt, fill: black, stroke: none) circle((127.78pt, 76.50pt), radius: 3.0pt, fill: black, stroke: none) circle((153.33pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((204.44pt, 102.00pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[20]) line((25.56pt, 0.00pt), (25.56pt, -3.00pt), stroke: 0.5pt + black) content((25.56pt, -5.00pt), anchor: "north", text(size: 8pt)[30]) line((51.11pt, 0.00pt), (51.11pt, -3.00pt), stroke: 0.5pt + black) content((51.11pt, -5.00pt), anchor: "north", text(size: 8pt)[40]) line((76.67pt, 0.00pt), (76.67pt, -3.00pt), stroke: 0.5pt + black) content((76.67pt, -5.00pt), anchor: "north", text(size: 8pt)[50]) line((102.22pt, 0.00pt), (102.22pt, -3.00pt), stroke: 0.5pt + black) content((102.22pt, -5.00pt), anchor: "north", text(size: 8pt)[60]) line((127.78pt, 0.00pt), (127.78pt, -3.00pt), stroke: 0.5pt + black) content((127.78pt, -5.00pt), anchor: "north", text(size: 8pt)[70]) line((153.33pt, 0.00pt), (153.33pt, -3.00pt), stroke: 0.5pt + black) content((153.33pt, -5.00pt), anchor: "north", text(size: 8pt)[80]) line((178.89pt, 0.00pt), (178.89pt, -3.00pt), stroke: 0.5pt + black) content((178.89pt, -5.00pt), anchor: "north", text(size: 8pt)[90]) line((204.44pt, 0.00pt), (204.44pt, -3.00pt), stroke: 0.5pt + black) content((204.44pt, -5.00pt), anchor: "north", text(size: 8pt)[100]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[110]) line((-3.00pt, 0.00pt), (0.00pt, 0.00pt), stroke: 0.5pt + black) content((-5.00pt, 0.00pt), anchor: "east", text(size: 8pt)[300]) line((-3.00pt, 17.00pt), (0.00pt, 17.00pt), stroke: 0.5pt + black) content((-5.00pt, 17.00pt), anchor: "east", text(size: 8pt)[320]) line((-3.00pt, 34.00pt), (0.00pt, 34.00pt), stroke: 0.5pt + black) content((-5.00pt, 34.00pt), anchor: "east", text(size: 8pt)[340]) line((-3.00pt, 51.00pt), (0.00pt, 51.00pt), stroke: 0.5pt + black) content((-5.00pt, 51.00pt), anchor: "east", text(size: 8pt)[360]) line((-3.00pt, 68.00pt), (0.00pt, 68.00pt), stroke: 0.5pt + black) content((-5.00pt, 68.00pt), anchor: "east", text(size: 8pt)[380]) line((-3.00pt, 85.00pt), (0.00pt, 85.00pt), stroke: 0.5pt + black) content((-5.00pt, 85.00pt), anchor: "east", text(size: 8pt)[400]) line((-3.00pt, 102.00pt), (0.00pt, 102.00pt), stroke: 0.5pt + black) content((-5.00pt, 102.00pt), anchor: "east", text(size: 8pt)[420]) line((-3.00pt, 119.00pt), (0.00pt, 119.00pt), stroke: 0.5pt + black) content((-5.00pt, 119.00pt), anchor: "east", text(size: 8pt)[440]) line((-3.00pt, 136.00pt), (0.00pt, 136.00pt), stroke: 0.5pt + black) content((-5.00pt, 136.00pt), anchor: "east", text(size: 8pt)[460]) line((-3.00pt, 153.00pt), (0.00pt, 153.00pt), stroke: 0.5pt + black) content((-5.00pt, 153.00pt), anchor: "east", text(size: 8pt)[480]) line((-3.00pt, 170.00pt), (0.00pt, 170.00pt), stroke: 0.5pt + black) content((-5.00pt, 170.00pt), anchor: "east", text(size: 8pt)[500]) })]), alt: "A scatter plot. The x-axis ranges from 20 to 110, in increments of 10. The y-axis ranges from 300 to 500, in increments of 20. The points are scattered in linear increasing order in a single row. Some of the points are as follows: (27, 345), (40, 360), (60, 380), (70, 390), (80, 400), and (100, 420). Note: all values are approximate.", caption: [Perfect positive relationship], ) The strength and direction (positive or negative) of a linear relationship can also be measured with a statistic called the #strong[correlation coefficient] (denoted #math.equation(block: false, alt: "r")[$r$]). Positive values of #math.equation(block: false, alt: "r")[$r$] indicate a positive relationship, while negative values of #math.equation(block: false, alt: "r")[$r$] indicate a negative relationship. Values of #math.equation(block: false, alt: "r")[$r$] close to 0 indicate a weak relationship, while values close to #math.equation(block: false, alt: "plus or minus 1")[$± 1$] correspond to a very strong relationship. Looking again at to , the correlation coefficients for each, in sequential order, are: ‒1, ‒0.97, ‒0.55, ‒0.03, 0.61, 0.97, and 1. There’s no firm rule that establishes a cutoff value of #math.equation(block: false, alt: "r")[$r$] to divide strong relationships from weak ones, but #math.equation(block: false, alt: "plus or minus 0.7")[$± 0.7$] is often given as the dividing line (i.e., if #math.equation(block: false, alt: "r greater than 0.7")[$r > 0.7$] or #math.equation(block: false, alt: "r less than minus 0.7")[$r < − 0.7$] the relationship is strong, and if #math.equation(block: false, alt: "minus 0.7 less than r less than 0.7")[$− 0.7 < r < 0.7$] the relationship is weak). The formula for computing #math.equation(block: false, alt: "r")[$r$] is very complicated; it’s almost never done without technology. Google Sheets will do the computation for you using the CORREL function. The syntax works like this: if your explanatory values are in cells A2 to A50 and the corresponding response values are in B2 to B50, then you can find the correlation coefficient by entering “=CORREL(A2:A50, B2:B50)”. (Note that the order doesn’t matter for correlation coefficients; “=CORREL(B2:B50, A2:A50)” will give the same result.) Let’s put all of this together in an example. #examplebox("Example 4")[Interpreting Scatter Plots][ Consider the four scatter plots below: + #figure( stdfig([#cetz.canvas({ import cetz.draw: * merge-path(stroke: (paint: rgb("#D62128"), thickness: 0.9pt), fill: none, { line((0.00pt, 133.57pt), (1.01pt, 132.08pt)) line((1.01pt, 132.08pt), (2.22pt, 130.29pt)) line((2.22pt, 130.29pt), (3.61pt, 128.23pt)) line((3.61pt, 128.23pt), (5.17pt, 125.93pt)) line((5.17pt, 125.93pt), (6.86pt, 123.43pt)) line((6.86pt, 123.43pt), (8.68pt, 120.75pt)) line((8.68pt, 120.75pt), (10.59pt, 117.92pt)) line((10.59pt, 117.92pt), (12.58pt, 114.98pt)) line((12.58pt, 114.98pt), (14.62pt, 111.95pt)) line((14.62pt, 111.95pt), (16.71pt, 108.88pt)) line((16.71pt, 108.88pt), (18.80pt, 105.78pt)) line((18.80pt, 105.78pt), (20.89pt, 102.69pt)) line((20.89pt, 102.69pt), (22.95pt, 99.65pt)) line((22.95pt, 99.65pt), (24.96pt, 96.67pt)) line((24.96pt, 96.67pt), (26.90pt, 93.81pt)) line((26.90pt, 93.81pt), (28.75pt, 91.07pt)) line((28.75pt, 91.07pt), (30.55pt, 88.37pt)) line((30.55pt, 88.37pt), (32.34pt, 85.59pt)) line((32.34pt, 85.59pt), (34.14pt, 82.76pt)) line((34.14pt, 82.76pt), (35.94pt, 79.88pt)) line((35.94pt, 79.88pt), (37.73pt, 76.97pt)) line((37.73pt, 76.97pt), (39.53pt, 74.07pt)) line((39.53pt, 74.07pt), (41.33pt, 71.17pt)) line((41.33pt, 71.17pt), (43.12pt, 68.30pt)) line((43.12pt, 68.30pt), (44.92pt, 65.48pt)) line((44.92pt, 65.48pt), (46.72pt, 62.73pt)) line((46.72pt, 62.73pt), (48.52pt, 60.06pt)) line((48.52pt, 60.06pt), (50.31pt, 57.49pt)) line((50.31pt, 57.49pt), (52.11pt, 55.04pt)) line((52.11pt, 55.04pt), (53.91pt, 52.72pt)) line((53.91pt, 52.72pt), (55.70pt, 50.56pt)) line((55.70pt, 50.56pt), (57.50pt, 48.57pt)) line((57.50pt, 48.57pt), (59.30pt, 46.74pt)) line((59.30pt, 46.74pt), (61.09pt, 45.05pt)) line((61.09pt, 45.05pt), (62.89pt, 43.48pt)) line((62.89pt, 43.48pt), (64.69pt, 42.03pt)) line((64.69pt, 42.03pt), (66.48pt, 40.68pt)) line((66.48pt, 40.68pt), (68.28pt, 39.43pt)) line((68.28pt, 39.43pt), (70.08pt, 38.27pt)) line((70.08pt, 38.27pt), (71.88pt, 37.19pt)) line((71.88pt, 37.19pt), (73.67pt, 36.18pt)) line((73.67pt, 36.18pt), (75.47pt, 35.23pt)) line((75.47pt, 35.23pt), (77.27pt, 34.34pt)) line((77.27pt, 34.34pt), (79.06pt, 33.49pt)) line((79.06pt, 33.49pt), (80.86pt, 32.67pt)) line((80.86pt, 32.67pt), (82.66pt, 31.89pt)) line((82.66pt, 31.89pt), (84.45pt, 31.12pt)) line((84.45pt, 31.12pt), (86.25pt, 30.36pt)) line((86.25pt, 30.36pt), (88.05pt, 29.62pt)) line((88.05pt, 29.62pt), (89.84pt, 28.93pt)) line((89.84pt, 28.93pt), (91.64pt, 28.29pt)) line((91.64pt, 28.29pt), (93.44pt, 27.70pt)) line((93.44pt, 27.70pt), (95.23pt, 27.16pt)) line((95.23pt, 27.16pt), (97.03pt, 26.66pt)) line((97.03pt, 26.66pt), (98.83pt, 26.21pt)) line((98.83pt, 26.21pt), (100.62pt, 25.80pt)) line((100.62pt, 25.80pt), (102.42pt, 25.45pt)) line((102.42pt, 25.45pt), (104.22pt, 25.14pt)) line((104.22pt, 25.14pt), (106.02pt, 24.88pt)) line((106.02pt, 24.88pt), (107.81pt, 24.67pt)) line((107.81pt, 24.67pt), (109.61pt, 24.50pt)) line((109.61pt, 24.50pt), (111.41pt, 24.38pt)) line((111.41pt, 24.38pt), (113.20pt, 24.31pt)) line((113.20pt, 24.31pt), (115.00pt, 24.29pt)) line((115.00pt, 24.29pt), (116.80pt, 24.31pt)) line((116.80pt, 24.31pt), (118.59pt, 24.38pt)) line((118.59pt, 24.38pt), (120.39pt, 24.50pt)) line((120.39pt, 24.50pt), (122.19pt, 24.67pt)) line((122.19pt, 24.67pt), (123.98pt, 24.88pt)) line((123.98pt, 24.88pt), (125.78pt, 25.14pt)) line((125.78pt, 25.14pt), (127.58pt, 25.45pt)) line((127.58pt, 25.45pt), (129.38pt, 25.80pt)) line((129.38pt, 25.80pt), (131.17pt, 26.21pt)) line((131.17pt, 26.21pt), (132.97pt, 26.66pt)) line((132.97pt, 26.66pt), (134.77pt, 27.16pt)) line((134.77pt, 27.16pt), (136.56pt, 27.70pt)) line((136.56pt, 27.70pt), (138.36pt, 28.29pt)) line((138.36pt, 28.29pt), (140.16pt, 28.93pt)) line((140.16pt, 28.93pt), (141.95pt, 29.62pt)) line((141.95pt, 29.62pt), (143.75pt, 30.36pt)) line((143.75pt, 30.36pt), (145.55pt, 31.14pt)) line((145.55pt, 31.14pt), (147.34pt, 31.98pt)) line((147.34pt, 31.98pt), (149.14pt, 32.86pt)) line((149.14pt, 32.86pt), (150.94pt, 33.80pt)) line((150.94pt, 33.80pt), (152.73pt, 34.79pt)) line((152.73pt, 34.79pt), (154.53pt, 35.82pt)) line((154.53pt, 35.82pt), (156.33pt, 36.90pt)) line((156.33pt, 36.90pt), (158.12pt, 38.02pt)) line((158.12pt, 38.02pt), (159.92pt, 39.19pt)) line((159.92pt, 39.19pt), (161.72pt, 40.41pt)) line((161.72pt, 40.41pt), (163.52pt, 41.66pt)) line((163.52pt, 41.66pt), (165.31pt, 42.96pt)) line((165.31pt, 42.96pt), (167.11pt, 44.31pt)) line((167.11pt, 44.31pt), (168.91pt, 45.69pt)) line((168.91pt, 45.69pt), (170.70pt, 47.11pt)) line((170.70pt, 47.11pt), (172.50pt, 48.57pt)) line((172.50pt, 48.57pt), (174.30pt, 50.04pt)) line((174.30pt, 50.04pt), (176.09pt, 51.51pt)) line((176.09pt, 51.51pt), (177.89pt, 52.98pt)) line((177.89pt, 52.98pt), (179.69pt, 54.46pt)) line((179.69pt, 54.46pt), (181.48pt, 55.97pt)) line((181.48pt, 55.97pt), (183.28pt, 57.53pt)) line((183.28pt, 57.53pt), (185.08pt, 59.13pt)) line((185.08pt, 59.13pt), (186.88pt, 60.79pt)) line((186.88pt, 60.79pt), (188.67pt, 62.53pt)) line((188.67pt, 62.53pt), (190.47pt, 64.35pt)) line((190.47pt, 64.35pt), (192.27pt, 66.27pt)) line((192.27pt, 66.27pt), (194.06pt, 68.29pt)) line((194.06pt, 68.29pt), (195.86pt, 70.44pt)) line((195.86pt, 70.44pt), (197.66pt, 72.72pt)) line((197.66pt, 72.72pt), (199.45pt, 75.14pt)) line((199.45pt, 75.14pt), (201.25pt, 77.71pt)) line((201.25pt, 77.71pt), (203.10pt, 80.57pt)) line((203.10pt, 80.57pt), (205.04pt, 83.80pt)) line((205.04pt, 83.80pt), (207.05pt, 87.33pt)) line((207.05pt, 87.33pt), (209.11pt, 91.11pt)) line((209.11pt, 91.11pt), (211.20pt, 95.07pt)) line((211.20pt, 95.07pt), (213.29pt, 99.16pt)) line((213.29pt, 99.16pt), (215.38pt, 103.31pt)) line((215.38pt, 103.31pt), (217.42pt, 107.46pt)) line((217.42pt, 107.46pt), (219.41pt, 111.56pt)) line((219.41pt, 111.56pt), (221.32pt, 115.54pt)) line((221.32pt, 115.54pt), (223.14pt, 119.34pt)) line((223.14pt, 119.34pt), (224.83pt, 122.91pt)) line((224.83pt, 122.91pt), (226.39pt, 126.17pt)) line((226.39pt, 126.17pt), (227.78pt, 129.08pt)) line((227.78pt, 129.08pt), (228.99pt, 131.57pt)) line((228.99pt, 131.57pt), (230.00pt, 133.57pt)) }) circle((0.00pt, 133.57pt), radius: 3.0pt, fill: black, stroke: none) circle((57.50pt, 48.57pt), radius: 3.0pt, fill: black, stroke: none) circle((115.00pt, 24.29pt), radius: 3.0pt, fill: black, stroke: none) circle((172.50pt, 48.57pt), radius: 3.0pt, fill: black, stroke: none) circle((201.25pt, 77.71pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 24.29pt), (234.00pt, 24.29pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((115.00pt, 0.00pt), (115.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 24.29pt), (0.00pt, 21.29pt), stroke: 0.5pt + black) content((0.00pt, 19.29pt), anchor: "north", text(size: 8pt)[−20]) line((57.50pt, 24.29pt), (57.50pt, 21.29pt), stroke: 0.5pt + black) content((57.50pt, 19.29pt), anchor: "north", text(size: 8pt)[−10]) line((172.50pt, 24.29pt), (172.50pt, 21.29pt), stroke: 0.5pt + black) content((172.50pt, 19.29pt), anchor: "north", text(size: 8pt)[10]) line((230.00pt, 24.29pt), (230.00pt, 21.29pt), stroke: 0.5pt + black) content((230.00pt, 19.29pt), anchor: "north", text(size: 8pt)[20]) line((112.00pt, 0.00pt), (115.00pt, 0.00pt), stroke: 0.5pt + black) content((110.00pt, 0.00pt), anchor: "east", text(size: 8pt)[−10]) line((112.00pt, 48.57pt), (115.00pt, 48.57pt), stroke: 0.5pt + black) content((110.00pt, 48.57pt), anchor: "east", text(size: 8pt)[10]) line((112.00pt, 72.86pt), (115.00pt, 72.86pt), stroke: 0.5pt + black) content((110.00pt, 72.86pt), anchor: "east", text(size: 8pt)[20]) line((112.00pt, 97.14pt), (115.00pt, 97.14pt), stroke: 0.5pt + black) content((110.00pt, 97.14pt), anchor: "east", text(size: 8pt)[30]) line((112.00pt, 121.43pt), (115.00pt, 121.43pt), stroke: 0.5pt + black) content((110.00pt, 121.43pt), anchor: "east", text(size: 8pt)[40]) line((112.00pt, 145.71pt), (115.00pt, 145.71pt), stroke: 0.5pt + black) content((110.00pt, 145.71pt), anchor: "east", text(size: 8pt)[50]) line((112.00pt, 170.00pt), (115.00pt, 170.00pt), stroke: 0.5pt + black) content((110.00pt, 170.00pt), anchor: "east", text(size: 8pt)[60]) })]), alt: "A scatter plot shows points arranged in a parabolic path. The x-axis ranges from 30 to 20, in increments of 10. The y-axis ranges from negative 10 to 60, in increments of 10. The points are scattered in the form of an open upward parabola. Some of the points are as follows: (negative 20, 45), (negative 10, 10), (0, 0), (10, 10), and (15, 22). Note: all values are approximate.", caption: none, ) + #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((46.00pt, 34.00pt), radius: 3.0pt, fill: black, stroke: none) circle((92.00pt, 68.00pt), radius: 3.0pt, fill: black, stroke: none) circle((138.00pt, 95.20pt), radius: 3.0pt, fill: black, stroke: none) circle((184.00pt, 119.00pt), radius: 3.0pt, fill: black, stroke: none) circle((207.00pt, 136.00pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 68.00pt), (234.00pt, 68.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((138.00pt, 0.00pt), (138.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 68.00pt), (0.00pt, 65.00pt), stroke: 0.5pt + black) content((0.00pt, 63.00pt), anchor: "north", text(size: 8pt)[−30]) line((46.00pt, 68.00pt), (46.00pt, 65.00pt), stroke: 0.5pt + black) content((46.00pt, 63.00pt), anchor: "north", text(size: 8pt)[−20]) line((92.00pt, 68.00pt), (92.00pt, 65.00pt), stroke: 0.5pt + black) content((92.00pt, 58.50pt), anchor: "north", text(size: 8pt)[−10]) line((184.00pt, 68.00pt), (184.00pt, 65.00pt), stroke: 0.5pt + black) content((184.00pt, 63.00pt), anchor: "north", text(size: 8pt)[10]) line((230.00pt, 68.00pt), (230.00pt, 65.00pt), stroke: 0.5pt + black) content((230.00pt, 63.00pt), anchor: "north", text(size: 8pt)[20]) line((135.00pt, 0.00pt), (138.00pt, 0.00pt), stroke: 0.5pt + black) content((133.00pt, 0.00pt), anchor: "east", text(size: 8pt)[−100]) line((135.00pt, 34.00pt), (138.00pt, 34.00pt), stroke: 0.5pt + black) content((133.00pt, 34.00pt), anchor: "east", text(size: 8pt)[−50]) line((135.00pt, 102.00pt), (138.00pt, 102.00pt), stroke: 0.5pt + black) content((133.00pt, 102.00pt), anchor: "east", text(size: 8pt)[50]) line((135.00pt, 136.00pt), (138.00pt, 136.00pt), stroke: 0.5pt + black) content((133.00pt, 136.00pt), anchor: "east", text(size: 8pt)[100]) line((135.00pt, 170.00pt), (138.00pt, 170.00pt), stroke: 0.5pt + black) content((133.00pt, 170.00pt), anchor: "east", text(size: 8pt)[150]) })]), alt: "A scatter plot shows points arranged in increasing order. The x-axis ranges from 30 to 20, in increments of 10. The y-axis ranges from negative 100 to 150, in increments of 50. The points are scattered in increasing order. Some of the points are as follows: (negative 20, negative 50), (negative 10, 0), (0, 40), (10, 75), and (15, 100). Note: all values are approximate.", caption: none, ) + #figure( stdfig([#cetz.canvas({ import cetz.draw: * circle((0.00pt, 127.50pt), radius: 3.0pt, fill: black, stroke: none) circle((46.00pt, 106.25pt), radius: 3.0pt, fill: black, stroke: none) circle((92.00pt, 85.00pt), radius: 3.0pt, fill: black, stroke: none) circle((138.00pt, 63.75pt), radius: 3.0pt, fill: black, stroke: none) circle((161.00pt, 21.25pt), radius: 3.0pt, fill: black, stroke: none) line((0.00pt, 85.00pt), (234.00pt, 85.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((92.00pt, 0.00pt), (92.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 85.00pt), (0.00pt, 82.00pt), stroke: 0.5pt + black) content((0.00pt, 80.00pt), anchor: "north", text(size: 8pt)[−20]) line((46.00pt, 85.00pt), (46.00pt, 82.00pt), stroke: 0.5pt + black) content((46.00pt, 80.00pt), anchor: "north", text(size: 8pt)[−10]) line((138.00pt, 85.00pt), (138.00pt, 82.00pt), stroke: 0.5pt + black) content((138.00pt, 80.00pt), anchor: "north", text(size: 8pt)[10]) line((184.00pt, 85.00pt), (184.00pt, 82.00pt), stroke: 0.5pt + black) content((184.00pt, 80.00pt), anchor: "north", text(size: 8pt)[20]) line((230.00pt, 85.00pt), (230.00pt, 82.00pt), stroke: 0.5pt + black) content((230.00pt, 80.00pt), anchor: "north", text(size: 8pt)[30]) line((89.00pt, 0.00pt), (92.00pt, 0.00pt), stroke: 0.5pt + black) content((87.00pt, 0.00pt), anchor: "east", text(size: 8pt)[−20]) line((89.00pt, 42.50pt), (92.00pt, 42.50pt), stroke: 0.5pt + black) content((87.00pt, 42.50pt), anchor: "east", text(size: 8pt)[−10]) line((89.00pt, 127.50pt), (92.00pt, 127.50pt), stroke: 0.5pt + black) content((87.00pt, 127.50pt), anchor: "east", text(size: 8pt)[10]) line((89.00pt, 170.00pt), (92.00pt, 170.00pt), stroke: 0.5pt + black) content((87.00pt, 170.00pt), anchor: "east", text(size: 8pt)[20]) })]), alt: "A scatter plot shows points arranged in decreasing order. The x-axis ranges from 30 to 20, in increments of 10. The y-axis ranges from negative 20 to 20, in increments of 10. The points are scattered in decreasing order. Some of the points are as follows: (negative 20, 10), (negative 10, 5), (0, 0), (10, negative 5), and (15, negative 15). Note: all values are approximate.", caption: none, ) + #figure( stdfig([#cetz.canvas({ import cetz.draw: * line((0.00pt, 0.00pt), (234.00pt, 0.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((115.00pt, 0.00pt), (115.00pt, 174.00pt), stroke: 0.7pt + black, mark: (end: ">", fill: black, size: 0.18)) line((0.00pt, 0.00pt), (0.00pt, -3.00pt), stroke: 0.5pt + black) content((0.00pt, -5.00pt), anchor: "north", text(size: 8pt)[−20]) line((57.50pt, 0.00pt), (57.50pt, -3.00pt), stroke: 0.5pt + black) content((57.50pt, -5.00pt), anchor: "north", text(size: 8pt)[−10]) line((172.50pt, 0.00pt), (172.50pt, -3.00pt), stroke: 0.5pt + black) content((172.50pt, -5.00pt), anchor: "north", text(size: 8pt)[10]) line((230.00pt, 0.00pt), (230.00pt, -3.00pt), stroke: 0.5pt + black) content((230.00pt, -5.00pt), anchor: "north", text(size: 8pt)[20]) line((112.00pt, 21.25pt), (115.00pt, 21.25pt), stroke: 0.5pt + black) content((110.00pt, 21.25pt), anchor: "east", text(size: 8pt)[5]) line((112.00pt, 42.50pt), (115.00pt, 42.50pt), stroke: 0.5pt + black) content((110.00pt, 42.50pt), anchor: "east", text(size: 8pt)[10]) line((112.00pt, 63.75pt), (115.00pt, 63.75pt), stroke: 0.5pt + black) content((110.00pt, 63.75pt), anchor: "east", text(size: 8pt)[15]) line((112.00pt, 85.00pt), (115.00pt, 85.00pt), stroke: 0.5pt + black) content((110.00pt, 85.00pt), anchor: "east", text(size: 8pt)[20]) line((112.00pt, 106.25pt), (115.00pt, 106.25pt), stroke: 0.5pt + black) content((110.00pt, 106.25pt), anchor: "east", text(size: 8pt)[25]) line((112.00pt, 127.50pt), (115.00pt, 127.50pt), stroke: 0.5pt + black) content((110.00pt, 127.50pt), anchor: "east", text(size: 8pt)[30]) line((112.00pt, 148.75pt), (115.00pt, 148.75pt), stroke: 0.5pt + black) content((110.00pt, 148.75pt), anchor: "east", text(size: 8pt)[35]) line((112.00pt, 170.00pt), (115.00pt, 170.00pt), stroke: 0.5pt + black) content((110.00pt, 170.00pt), anchor: "east", text(size: 8pt)[40]) })]), alt: "A scatter plot. The x-axis ranges from 30 to 20, in increments of 10. The y-axis ranges from 0 to 40, in increments of 5. The points are scattered throughout and the points lie from negative 20 to 15 on the horizontal axis and 0 to 30 on the vertical axis.", caption: none, ) For each of these, answer the following questions: + Is there a curved pattern in the data? If yes, stop here. If no, continue to part b. + Classify the strength and direction of the relationship. Make a guess at the value of #math.equation(block: false, alt: "r")[$r$]. #solutionbox[ + + Yes, there is a curved pattern. + + No, there’s no curved pattern. + Since the points tend upward as we move from left to right, this is a positive relationship. The points seem pretty closely grouped around a line, so it’s fairly strong. Comparing this scatter plot to those in to , we can see that the relationship is stronger than the one in (#math.equation(block: false, alt: "r equals 0.61")[$r = 0.61$] ) but not as strong as the one in (#math.equation(block: false, alt: "r equals 0.97")[$r = 0.97$]). So, the value of the correlation coefficient is somewhere between the two. We might guess that #math.equation(block: false, alt: "r equals 0.9")[$r = 0.9$]. + + No, there’s no curved pattern. + Since the points tend downward as we move from left to right, this is a negative relationship. The points are not tightly grouped around a line, but the pattern is clear. It looks like it has approximately the same strength as the plot in , just with the opposite sign. So, we might guess that #math.equation(block: false, alt: "r equals minus 0.6")[$r = − 0.6$]. + + No, there’s no curved pattern. + Since the points don’t really tend upward or downward as we move from left to right, there is no real relationship here. Thus, #math.equation(block: false, alt: "r approximately equals 0")[$r ≈ 0$]. ] ] #examplebox("Example 5")[Finding the Correlation Coefficient][ The data that were plotted in the previous example can be found in the dataset #link("https://openstax.org/r/Chapter8_Data-Sets")[“correlationcoefficient1”]. All of them share the same values for the explanatory variable #math.equation(block: false, alt: "x")[$x$]. The four responses are labeled #math.equation(block: false, alt: "y 1")[$y 1$] through #math.equation(block: false, alt: "y 4")[$y 4$]. Compute the correlation coefficients for each, if appropriate, using Google Sheets. Round to the nearest hundredth. #solutionbox[ #strong[Step 1:] There is a curved pattern in the data, so the correlation coefficient isn’t meaningful. #strong[Step 2:] Using “=CORREL(A2:A101, C2:C101)” we get #math.equation(block: false, alt: "r equals 0.89")[$r = 0.89$]. #strong[Step 3:] Using “=CORREL(A2:A101, D2:D101)” we get #math.equation(block: false, alt: "r equals minus 0.66")[$r = − 0.66$]. #strong[Step 4:] Using “=CORREL(A2:A101, E2:E101)” we get #math.equation(block: false, alt: "r equals minus 0.04")[$r = − 0.04$]. ] ] #notebox("Work It Out", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ #emph[Winning with Statistics] Billy Beane, the former general manager of the Oakland A’s baseball team, famously took his low budget team to unprecedented heights by using statistics to identify undervalued players; his story is recounted in the book #emph[Moneyball] (which was later made into a movie, with Brad Pitt playing Beane). You can do the same thing: Take a look #link("https://openstax.org/r/sports-reference")[at team statistics in the sport of your choice] and try to identify a statistic that’s most closely related to winning (meaning that it has the highest correlation coefficient with team wins). ] === Linear Regression The final step in our analysis of the relationship between two datasets is to find and use the equation of the regression line. For a given set of explanatory and response data, the #strong[regression line] (also called the #strong[least-squares line] or #strong[line of best fit]) is the line that does the best job of approximating the data. What does it mean to say that a particular line does the “best job” of approximating the data? The way that statisticians characterize this “best line” is rather technical, but we’ll include it for the sake of satisfying your curiosity (and backing up the claim of "best"). Imagine drawing a line that looks like it does a pretty good job of approximating the data. Most of the points in the scatter plot will probably not fall exactly on the line; the distance above or below the line a given point falls is called that point’s #emph[residual]. We could compute the residuals for every point in the scatter plot. If you take all those residuals and square them, then add the results together, you get a statistic called the #emph[sum of squared errors] for the line (the name tells you what it is: “sum” because we’re adding, “squared” because we’re squaring, and “errors” is another word for “residuals”). The line that we choose to be the “best” is the one that has the smallest possible sum of squared errors. The implied minimization (“smallest”) is where the “least” in “least squares” comes from; the “squares” comes from the fact that we’re minimizing the sum of #emph[squared] errors. This is very similar to the process we outlined in the "game" that we used to introduce the mean. Both the regression line and the mean are designed to minimize a sum of squared errors. Here ends the super technical part. ==== Finding the Equation of the Regression Line So, how do we find the equation of the regression line? Recall the point-slope form of the equation of a line: #notebox("Formula", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ If a line has slope #math.equation(block: false, alt: "m")[$m$] and passes through a point #math.equation(block: false, alt: "open parenthesis x sub 0 , y sub 0 close parenthesis")[$( x_(0) , y_(0) )$], then the point-slope form of the equation of the line is: #math.equation(block: true, alt: "y equals m open parenthesis x minus x sub 0 close parenthesis plus y sub 0")[$y = m ( x − x_(0) ) + y_(0)$] ] The regression line has two properties that we can use to find its equation. First, it always passes through the #emph[point of means]. If #math.equation(block: false, alt: "x ¯")[$overline(x)$] and #math.equation(block: false, alt: "y ¯")[$overline(y)$] are the means of the explanatory and response datasets, respectively, then the point of means is #math.equation(block: false, alt: "open parenthesis x ¯ , y ¯ close parenthesis")[$( overline(x) , overline(y) )$]. We’ll use that as the point in the point-slope form of the equation. Second, if #math.equation(block: false, alt: "s sub x")[$s_(x)$] and #math.equation(block: false, alt: "s sub y")[$s_(y)$] are the standard deviations of the explanatory and response datasets, respectively, and if #math.equation(block: false, alt: "r")[$r$] is the correlation coefficient, then the slope is #math.equation(block: false, alt: "m equals r times the fraction s sub y over s sub x")[$m = r × frac(s_(y), s_(x))$]. Putting all that together with the point-slope formula gives us this: #notebox("Formula", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ Suppose #math.equation(block: false, alt: "x")[$x$] and #math.equation(block: false, alt: "y")[$y$] are explanatory and response datasets that have a linear relationship. If their means are #math.equation(block: false, alt: "x ¯")[$overline(x)$] and #math.equation(block: false, alt: "y ¯")[$overline(y)$] respectively, their standard deviations are #math.equation(block: false, alt: "s sub x")[$s_(x)$] and #math.equation(block: false, alt: "s sub y")[$s_(y)$] respectively, and their correlation coefficient is #math.equation(block: false, alt: "r")[$r$], then the equation of the regression line is: #math.equation(block: true, alt: "y equals r open parenthesis the fraction s sub y over s sub x close parenthesis open parenthesis x minus x ¯ close parenthesis plus y ¯")[$y = r ( frac(s_(y), s_(x)) ) ( x − overline(x) ) + overline(y)$]. ] Let's walk through an example. #examplebox("Example 6")[Finding the Equation of the Regression Line from Statistics][ Suppose you have datasets #math.equation(block: false, alt: "x")[$x$] and #math.equation(block: false, alt: "y")[$y$] with the following statistics: #math.equation(block: false, alt: "x")[$x$] has mean 21 and standard deviation 4, #math.equation(block: false, alt: "y")[$y$] has mean 8 and standard deviation 2, and their correlation coefficient is −0.4. What’s the equation of the regression line? #solutionbox[ #strong[Step 1:] We’re given #math.equation(block: false, alt: "x ¯ equals 21")[$overline(x) = 21$], #math.equation(block: false, alt: "s sub x equals 4")[$s_(x) = 4$], #math.equation(block: false, alt: "y ¯ equals 8")[$overline(y) = 8$], #math.equation(block: false, alt: "s sub y equals 2")[$s_(y) = 2$], and #math.equation(block: false, alt: "r equals minus 0.4")[$r = − 0.4$]. Let's start with the formula for the equation of the regression line: #math.equation(block: true, alt: "y equals r open parenthesis the fraction s sub y over s sub x close parenthesis open parenthesis x minus x ¯ close parenthesis plus y ¯")[$y = r ( frac(s_(y), s_(x)) ) ( x − overline(x) ) + overline(y)$] #strong[Step 2:] Plugging in our values gives us: #math.equation(block: true, alt: "y equals minus 0.4 open parenthesis the fraction 2 over 4 close parenthesis open parenthesis x minus 21 close parenthesis plus 8")[$y = − 0.4 ( frac(2, 4) ) ( x − 21 ) + 8$] #strong[Step 3:] Our final regression line equation is: #math.equation(block: true, alt: "y equals minus 0.2 x plus 12.2")[$y = − 0.2 x + 12.2$] ] ] As you can see, finding the equation of the regression line involves a lot of steps if you have to find all of the values of the needed quantities yourself. But, as usual, technology comes to our rescue. This video (which you actually watched earlier when learning how to create scatter plots) covers the regression line at around the 3:30 mark. Note that Google Sheets calls it the "trendline." Let's put this into practice. #examplebox("Example 7")[Finding the Equation of the Regression Line Using Google Sheets][ In Example 3, we considered the relationship between goals scored (GF) and goals against (GA) using the dataset #link("https://openstax.org/r/Chapter8_Data-Sets")[“NHL19”]. Recreate the scatter plot in Google Sheets, and use it to find the equation of the regression line. #solutionbox[ Once we have recreated the scatter plot, we find the equation of the regression line by clicking the three dots at the top right of the plot, selecting “Edit chart,” then clicking on “Customize” and “Series.” We add the regression line by checking the box next to “Trendline,” and then we show the equation by selecting “Use Equation” in the drop-down menu under “Label.” The equation of the tangent line is #math.equation(block: false, alt: "y equals minus 0.0554 x plus 261")[$y = − 0.0554 x + 261$]. ] ] ==== Using the Equation of the Regression Line Once we’ve found the equation of the regression line, what do we do with it? We’ll look at two possible applications: making predictions and interpreting the slope. We can use the equation of the regression line to predict the response value #math.equation(block: false, alt: "y")[$y$] for a given explanatory value #math.equation(block: false, alt: "x")[$x$]. All we have to do is plug that explanatory value into the formula and see what response value results. This is useful in two ways: first, it can be used to make a guess about an unknown data value (like one that hasn’t been observed yet). Second, it can be used to evaluate performance (meaning, we can predict an outcome given a particular event). In Example 2, we created a scatter plot of final exam scores vs. midterm exam scores using this data: #figure(table( columns: 3, align: left, inset: 6pt, table.header([Name], [Midterm Grade], [Final Grade]), [Allison], [88], [84], [Benjamin], [71], [80], [Carly], [75], [77], [Daniel], [94], [95], [Elmo], [68], [73], )) The equation of the regression line is #math.equation(block: false, alt: "y equals 0.687 x plus 27.4")[$y = 0.687 x + 27.4$], where #math.equation(block: false, alt: "y")[$y$] is the final exam score and #math.equation(block: false, alt: "x")[$x$] is the midterm exam score. If Frank scored 85 on the midterm, then our prediction for his final exam score is #math.equation(block: false, alt: "0.687 times 85 plus 27.4 equals 85.795")[$0.687 × 85 + 27.4 = 85.795$]. To use the regression line to evaluate performance, we use a data value we’ve already observed. For example, Allison scored 88 on the midterm. The regression line predicts that someone who scores an 88 on the midterm will get #math.equation(block: false, alt: "0.687 times 88 plus 27.4 equals 87.856")[$0.687 × 88 + 27.4 = 87.856$] on the final. Allison actually scored 84 on the final, meaning she underperformed expectations by almost 4 points #math.equation(block: false, alt: "open parenthesis 87.856 minus 84 close parenthesis")[$( 87.856 − 84 )$]. The second application of the equation of the regression line is interpreting the slope of the line to describe the relationship between the explanatory and response datasets. For the exam data in the previous paragraph, the slope of the regression line is 0.687. Recall that the slope of a line can be computed by finding two points on the line and dividing the difference in the #math.equation(block: false, alt: "y")[$y$]-values of those points by the difference in the #math.equation(block: false, alt: "x")[$x$]-values. Keeping that in mind, we can interpret our slope as #math.equation(block: false, alt: "0.687 equals the fraction difference in final scores over difference in midterm scores")[$0.687 = frac("difference in final scores", "difference in midterm scores")$] . Multiplying both sides of that equation by the denominator of the fraction, we get #math.equation(block: false, alt: "0.687 times difference in midterm scores equals difference in final scores")[$0.687 × "difference in midterm scores" = "difference in final scores"$]. Thus, a one-point increase in the midterm score would result in a predicted increase in the final score of 0.687 points. A ten-point drop in the midterm score would give us a decrease in the predicted final score of 6.87 points. In general, the slope gives us the predicted change in the response that corresponds to a one unit increase in the explanatory variable. #examplebox("Example 8")[Applying the Equation of the Regression Line][ The data in #link("https://openstax.org/r/Chapter8_Data-Sets")[“MLB2019Off”] gives offensive team stats for the 2019 Major League Baseball season. Use that dataset to answer the following questions: + What is the equation of the regression line for runs (R) vs. hits (H)? + How many runs would we expect a team to score if the team got 1500 hits in a season? + Did the Kansas City Royals (KCR) overperform or underperform in terms of runs scored, based on their hit total? By how much? + Write a sentence to interpret the slope of the regression line. #solutionbox[ + Using Google Sheets, we find that the regression line equation is #math.equation(block: false, alt: "y equals 0.884 x minus 456")[$y = 0.884 x − 456$], where #math.equation(block: false, alt: "y")[$y$] is the number of runs scored and #math.equation(block: false, alt: "x")[$x$] is the number of hits. + Plugging 1500 into the equation of the regression line, we get #math.equation(block: false, alt: "0.884 times 1500 minus 456 equals 870")[$0.884 × 1500 − 456 = 870$]. We would predict that a team with 1500 hits would score 870 runs. + The Royals had 1356 hits, so we would predict their run total to be #math.equation(block: false, alt: "0.884 times 1356 minus 456 approximately equals 743")[$0.884 × 1356 − 456 ≈ 743$]. They actually scored 691 runs, so they underperformed expectations by 52 runs #math.equation(block: false, alt: "open parenthesis 743 minus 691 close parenthesis")[$( 743 − 691 )$]. + The slope gives us the predicted change in the response that corresponds to a one unit increase in the explanatory variable. So, we expect one additional hit to result in 0.884 more runs. Since 0.884 runs doesn’t really make sense, we can get a better interpretation by multiplying through by ten or one hundred: Ten additional hits will result in almost nine additional runs, or a hundred additional hits will yield on average just over 88 additional runs. ] ] #notebox("Who Knew?", rgb("#183B6F"), rgb("#183B6F"), rgb("#EFF1F5"))[ #emph[Math and the Movies] Statistics and regression are used by Hollywood movie producers to decide what movies to make, and to predict how much money they’ll earn at the box office. According to #link("https://openstax.org/r/American-Statistical-Association")[the American Statistical Association], not only do producers use statistics to identify the next potential blockbuster, but they’ve also pinned down how much money awards add to the bottom line. (An Academy Award is worth about \$3 million!) In addition, studios use their streaming services to gather data about their customers and the types of movies they watch; this data helps them learn what kinds of entertainment their customers want more of. ] #notebox("Work It Out", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ #emph[Collecting and Analyzing Your Own Data] This section has demonstrated many pairs of related quantitative datasets. Think about some quantitative variables that you can ask your classmates about, which might be related. Once you have some ideas, collect the data from your classmates. Then analyze the data by creating a scatter plot, finding the equation of the regression line (if appropriate), and interpreting it. ] === Extrapolation A very common misuse of regression techniques involves #strong[extrapolation], which involves making a prediction about something that doesn't belong in the dataset. #examplebox("Example 9")[More Applying the Equation of the Regression Line][ The data in #link("https://openstax.org/r/Chapter8_Data-Sets")[“WNBA2019”] gives team statistics from the 2019 WNBA season. Use that dataset to answer these questions about team wins (W) and the proportion of team field goals made (FG%, the number of shots made divided by the number of shots attempted. Even though this column is labeled using a percent sign, the values are not expressed as percentages): + What is the equation of the regression line for wins vs. proportion of made field goals? + How many wins would we expect for a team that makes 42% of its shots? + Did the New York Liberty overperform or underperform in terms of wins, based on the team’s proportion of made field goals? + Write a sentence to interpret the slope of the regression line. #solutionbox[ + Using Google Sheets, we get the equation #math.equation(block: false, alt: "y equals 178.097 x minus 58.543")[$y = 178.097 x − 58.543$], where #math.equation(block: false, alt: "x")[$x$] is the proportion of field goals made and #math.equation(block: false, alt: "y")[$y$] is the number of wins. + Since 42% corresponds to a proportion of 0.42, we’ll plug 0.42 into the regression equation for #math.equation(block: false, alt: "x")[$x$], which gives us #math.equation(block: false, alt: "178.097 times 0.42 minus 58.543 approximately equals 16.26")[$178.097 × 0.42 − 58.543 ≈ 16.26$]. We would predict that a team that makes 42% of its shots would win about 16 games. + The New York Liberty made 41.4% of their shots, so we expect they would have #math.equation(block: false, alt: "178.097 times 0.414 minus 58.543 approximately equals 15.19")[$178.097 × 0.414 − 58.543 ≈ 15.19$]wins. In fact, they had only 10 wins, so they underperformed expectations by over 5 wins. + #strong[Step 1:] The slope gives us the expected increase in the response that corresponds to a one unit increase in the explanatory variable. If we simply go with that interpretation, we would get a sentence like “We expect an increase in proportion of field goals made of 1 would result in an additional 178 wins.” However, that sentence doesn't make much sense. Let's consider why. #linebreak() #strong[Step 2:] First, proportions must be between 0 and 1, the proportion of made field goals can’t be increased by 1 and still make sense. Second, the total number of games played is only 34, so no team could get an additional 178 wins! So, we’ll have to change the units. #linebreak() #strong[Step 3:] Since the proportions of made field goals are often expressed as a percentage, we could try to use that. If we express the slope as a fraction with 1 in the denominator (remember, the denominator represents the proportion of field goals made), then convert the denominator to a percentage and simplify, we get #math.equation(block: false, alt: "the fraction 178.097 over 1 equals the fraction 178.097 over 100 % approximately equals the fraction 1.78 over 1 %")[$display(frac(178.097, 1)) = display(frac(178.097, 100 %)) ≈ display(frac(1.78, 1 %))$]. #linebreak() #strong[Step 4:] So, an increase in field goal percentage of 1% would result in an expected increase of 1.78 wins. ] ] === Correlation Does Not Imply Causation One of the most common fallacies about statistics has to do with the relationship between two datasets. In the dataset #link("https://openstax.org/r/Chapter8_Data-Sets")[“Public”], we find that the correlation coefficient between the 75th percentile math SAT score and the 75th percentile verbal SAT score is 0.92, which is really strong. The slope of the regression line that predicts the verbal score from the math score is 0.729, which we might interpret as follows: “If the 75th percentile math SAT score goes up by 10 points, we’d expect the corresponding verbal SAT score to go up by just over 7 points.” Does the increasing math score #emph[cause] the increase in the verbal score? Probably not. What’s really going on is that there’s a third variable that’s affecting them both: To raise the SAT math score by 10 points, a school will recruit students who do better on the SAT in general; these students will also naturally have higher SAT verbal scores. This third variable is sometimes called a #emph[lurking variable] or a #emph[confounding variable]. Unless all possible lurking variables are ruled out, we cannot conclude that one thing causes another. #notebox("People in Mathematics", rgb("#183B6F"), rgb("#183B6F"), rgb("#EFF1F5"))[ #emph[Dr. Talithia Williams] #figure(figph[A photo of Dr. Williams], alt: "A photo of Dr. Williams", caption: [A photo of Dr. Williams]) Dr. Talithia Williams is a statistician on the faculty of Harvey Mudd College, and the first Black woman to achieve tenure at this university. She advocates for more women to become involved in the fields of engineering and science, and is on the board of directors for the EDGE Foundation, an organization that helps women obtain advanced degrees in mathematics (EDGE standing for Enhancing Diversity in Graduate Education). In 2018, Dr. Williams published the book Power in Numbers: The Rebel Women of Mathematics, a retrospective look at historical female figures who have contributed to the development of the field of mathematics. Dr. Williams earned a Master’s degree in Mathematics from Howard University and a Master’s in Statistics from Rice University, and also went on to earn her Ph.D. in Statistics from Rice. She has held research appointments at the Jet Propulsion Laboratory, the National Security Agency, and NASA. Her research focuses on the environmental and medical applications of statistics. In 2014, she gave #link("https://openstax.org/r/TED-Talk_talithia_williams")[a popular TED talk titled “Own Your Body’s Data”] that discussed the potential insights to be gained from collecting personal health data. She was even recently a host for the NOVA Wonders documentary series and a narrator for the NOVA Universe series on PBS. To stay up-to-date on Dr. Williams’s accomplishments, #link("https://openstax.org/r/twit_talithiaw")[you can follow her on Twitter] or #link("https://openstax.org/r/facebk_talithiaw")[her Facebook account]. ] #notebox("Who Knew?", rgb("#183B6F"), rgb("#183B6F"), rgb("#EFF1F5"))[ #emph[Statistics and Eugenics] Some of the brightest minds in the history of statistics unfortunately decided to use their considerable intellects to further a pseudoscience known as eugenics. Eugenicists took Charles Darwin’s theories of evolution and ruthlessly applied them to the human race. Francis Galton (1822–1911), a cousin of Darwin and also the mathematician who invented the formula for standard deviation, claimed that people in the British upper classes possessed higher intelligence due to their superior breeding. Karl Pearson (1857–1936), who derived the formula for the correlation coefficient, argued in #emph[National Life from the Standpoint of Science], that, instead of providing social welfare programs, nations could better improve the fortunes of the poor by waging “war with inferior races.” Ronald Fisher (1890–1962) was possibly the most important statistician of the 20th century, having invented several new techniques (including the ubiquitous analysis of variance), and yet he also founded the Cambridge University Undergraduates Eugenics Society, whose self-prescribed goal was to evangelize “not by precept only, but by example, the doctrine of a new natural ability of worth and blood.” When eugenics took hold in the United States, it was used to justify terrible acts by the government, including the forced sterilization of individuals with mental illness, epilepsy, a physical impairment (like blindness), or a criminal history. The Nazi regime took these ideas to their ultimate, terrible conclusion: killing people who had mental or physical disabilities, or who were born into an “inferior” race. Over six million people died in this Holocaust, one of the darkest events in human history. To learn more, watch this video about #link("https://openstax.org/r/Galton-and-eugenics")[Francis Galton and the legacy of eugenics] ] === Key Terms - response variable (dependent variable) - explanatory variable (independent variable) - scatter plot - positive linear relationship - negative linear relationship - correlation coefficient - regression line (least-squares line, line of best fit) === Key Concepts - If one variable affects the value of another variable, we say the first is an explanatory variable and the second is a response variable. - Scatter plots place a point in the #math.equation(block: false, alt: "xy")[$italic("xy")$]-plane for each unit in the dataset. The #math.equation(block: false, alt: "x")[$italic(x)$]-value is the value of the explanatory variable, and the #math.equation(block: false, alt: "y")[$italic(y)$]-value is the value of the response variable. - The correlation coefficient #math.equation(block: false, alt: "r")[$r$] gives us information about the strength and direction of the relationship between two variables. If #math.equation(block: false, alt: "r")[$r$] is positive, the relationship is positive: an increase in the value of the explanatory variable tends to correspond to an #strong[increase] in the value of the response variable. If #math.equation(block: false, alt: "r")[$r$] is negative, the relationship is negative: an increase in the value of the explanatory variable tends to correspond to a #strong[decrease] in the value of the response variable. Values of #math.equation(block: false, alt: "r")[$r$] that are close to 0 indicate weak relationships, while values close to –1 or indicate strong relationships. - The regression line for a relationship between two variables is the line that best represents the data. It can be used to predict values of the response variable for a given value of the explanatory variable. === Formulas If a line has slope #math.equation(block: false, alt: "m")[$m$] and passes through a point #math.equation(block: false, alt: "open parenthesis x sub 0 , y sub 0 close parenthesis")[$( x_(0) , y_(0) )$], then the point-slope form of the equation of the line is: #math.equation(block: true, alt: "y equals m open parenthesis x minus x sub 0 close parenthesis plus y sub 0")[$y = m ( x − x_(0) ) + y_(0)$] Suppose #math.equation(block: false, alt: "x")[$x$] and #math.equation(block: false, alt: "y")[$y$] are explanatory and response datasets that have a linear relationship. If their means are #math.equation(block: false, alt: "x ¯")[$overline(x)$] and #math.equation(block: false, alt: "y ¯")[$overline(y)$] respectively, their standard deviations are #math.equation(block: false, alt: "s sub x")[$s_(x)$] and #math.equation(block: false, alt: "s sub y")[$s_(y)$] respectively, and their correlation coefficient is #math.equation(block: false, alt: "r")[$r$], then the equation of the regression line is: #math.equation(block: true, alt: "y equals r open parenthesis the fraction s sub y over s sub x close parenthesis open parenthesis x minus x ¯ close parenthesis plus y ¯ .")[$y = r ( frac(s_(y), s_(x)) ) ( x − overline(x) ) + overline(y) .$] === Videos - #link("https://openstax.org/r/Scatter-Plots")[Making Scatter Plots in Google Sheets] === Projects + Browse through some news websites to find five stories that report on data and include data visualizations. Can you tell from the report how the data were collected? Was randomization used? Are the visualizations appropriate for the data? Are the visualizations presented in a way that might bias the reader? + We discussed three measures of centrality in this chapter: the mode, the median, and the mean. In a broader context, the mean as we discussed it is more properly called the #emph[arithmetic mean], to distinguish it from other types of means. Examples of these include the geometric mean, harmonic mean, truncated mean, and weighted mean. How are these computed? How do they compare to the arithmetic mean? In what situations would each of these be preferred to the arithmetic mean? + #emph[Simpson’s Paradox] is a statistical phenomenon that can sometimes appear when we observe a relationship within several subgroups of a population, but when the data for all thegroups are analyzed all together, the opposite relationship appears. Find some examples of Simpson’s Paradox in real-world situations, and write a paragraph or two that would explain the concept to someone who had never studied statistics before.