#set document(title: "8.4 Range and Standard Deviation", 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.4#h(0.6em)Range and Standard Deviation #figure(figph[A standardized test form with bubbles for options A, B, C, and D is shown. The answer choices for the first three questions are filled in.], alt: "A standardized test form with bubbles for options A, B, C, and D is shown. The answer choices for the first three questions are filled in.", caption: [Measures of spread help us get a better understanding of test scores.]) === Learning Objectives After completing this section, you should be able to: + Calculate the range of a dataset + Calculate the standard deviation of a dataset Measures of centrality like the mean can give us only part of the picture that a dataset paints. For example, let’s say you’ve just gotten the results of a standardized test back, and your score was 138. The mean score on the test is 120. So, your score is above average! But how good is it #emph[really]? If all the scores were between 100 and 140, then you know your score must be among the best. But if the scores ranged from 0 to 200, then maybe 140 is good, but not great (though still above average). Knowing information about how the data are spread out can help us put a particular data value in better context. In this section, we’ll look at two numbers that help us describe the spread in the data: the range and the standard deviation. These numbers are called measures of dispersion. === The Range Our first measure of dispersion is the #strong[range], or the difference between the maximum and minimum values in the set. It’s the measure we used in the standardized test example above. Let’s look at a couple of examples. #examplebox("Example 1")[Finding the Range][ You survey some of your friends to find out how many hours they work each week. Their responses are: 5, 20, 8, 10, 35, 12. What is the range? #solutionbox[ The maximum value in the set is 35 and the minimum is 5, so the range is #math.equation(block: false, alt: "35 minus 5 equals 30")[$35 − 5 = 30$]. ] ] For large datasets, finding the maximum and minimum values can be daunting. There are two ways to do it in a spreadsheet. First, you can ask the spreadsheet program to sort the data from smallest to largest, then find the first and last numbers on the sorted list. The second method uses built-in functions to find the minimum and maximum. #notebox("Video", rgb("#DC2626"), rgb("#DC2626"), rgb("#f7f8fa"))[ #link("https://openstax.org/r/min-max_Google-Sheet")[Find the Minimum and Maximum Using Google Sheets] ] In either method, once you’ve found the maximum and minimum, all you have to do is subtract to find the range. #examplebox("Example 2")[Finding the Range with Google Sheets][ The data in #link("https://openstax.org/r/Chapter8_Data-Sets")[“AvgSAT”] contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the range of these average SAT scores? #solutionbox[ #strong[Step 1:] To find the maximum, click on an empty cell in the spreadsheet, type “=MAX(”, and then click on the letter that marks the top of the column containing the AvgSAT data. That inserts a reference to the column into our function. Then we close the parentheses and hit the enter key. The formula is replaced with the maximum value in our data: 1566. #linebreak() #strong[Step 2:] Using the same process (but with “MIN” instead of “MAX”), we find the minimum value is 785. #linebreak() #strong[Step 3:] So, the range is #math.equation(block: false, alt: "1566 minus 785 equals 781")[$1566 − 785 = 781$]. ] ] The range is very easy to compute, but it depends only on two of the data values in the entire set. If there happens to be just one unusually high or low data value, then the range might give a distorted measure of dispersion. Our next measure takes every single data value into account, making it more reliable. === The Standard Deviation The standard deviation is a measure of dispersion that can be interpreted as approximately the average distance of every data value from the mean. (This distance from the mean is the “deviation” in “standard deviation.”) #notebox("Formula", rgb("#059669"), rgb("#007942"), rgb("#EAF3EC"))[ The standard deviation is computed as follows: #math.equation(block: true, alt: "s equals the square root of the fraction ∑ open parenthesis x minus x ¯ close parenthesis squared over n minus 1")[$s = sqrt(frac(display(∑ attach(( x − overline(x) ), t: 2)), n − 1))$] Here, #math.equation(block: false, alt: "x")[$x$] represents each data value, #math.equation(block: false, alt: "x ¯")[$overline(x)$] is the mean of the data values, #math.equation(block: false, alt: "n")[$n$] is the number of data values, and the capital sigma (#math.equation(block: false, alt: "Σ")[$upright(Σ)$]) indicates that we take a sum. ] To compute the standard deviation using the formula, we follow the steps below: + Compute the mean of all the data values. + Subtract the mean from each data value. + Square those differences. + Add up the results in step 3. + Divide the result in step 4 by #math.equation(block: false, alt: "n minus 1")[$n − 1$] + Take the square root of the result in step 5. Let’s see that process in action. #examplebox("Example 3")[Computing the Standard Deviation][ You surveyed some of your friends to find out how many hours they work each week. Their responses were: 5, 20, 8, 10, 35, 12. What is the standard deviation? #solutionbox[ Let’s follow the six steps mentioned previously to compute the standard deviation. #strong[Step 1]: Find the mean: #math.equation(block: false, alt: "x ¯ equals the fraction 5 plus 20 plus 8 plus 10 plus 35 plus 12 over 6 equals 15")[$overline(x) = frac(5 + 20 + 8 + 10 + 35 + 12, 6) = 15$]. #strong[Step 2]: Subtract the mean from each data value. To help keep track, let’s do this in a table. In the first row, we’ll list each of our data values (and we’ll label the row #math.equation(block: false, alt: "x")[$x$]); in the second, we’ll subtract #math.equation(block: false, alt: "x ¯ equals 15")[$overline(x) = 15$] from each data value. #figure(table( columns: 7, align: left, inset: 6pt, table.header([#math.equation(block: false, alt: "x")[$x$]], [5], [20], [8], [10], [35], [12]), [#math.equation(block: false, alt: "x minus x ¯")[$x − overline(x)$]], [−10], [5], [–7], [–5], [20], [–3], )) #strong[Step 3:] Square the differences. Let’s add a row to our table for those values: #figure(table( columns: 7, align: left, inset: 6pt, table.header([#math.equation(block: false, alt: "x")[$x$]], [5], [20], [8], [10], [35], [12]), [#math.equation(block: false, alt: "x minus x ¯")[$x − overline(x)$]], [−10], [5], [–7], [–5], [20], [–3], [#math.equation(block: false, alt: "open parenthesis x minus x ¯ close parenthesis squared")[$attach(( x − overline(x) ), t: 2)$]], [100], [25], [49], [25], [400], [9], )) #strong[Step 4:] Add up those squares: #math.equation(block: false, alt: "100 plus 25 plus 49 plus 25 plus 400 plus 9 equals 608")[$100 " " + " " 25 " " + " " 49 " " + " " 25 " " + " " 400 " " + " " 9 " " = " " 608$]. #strong[Step 5:] Divide the sum by #math.equation(block: false, alt: "n minus 1")[$n − 1$]. Since we have 6 data values, that gives us #math.equation(block: false, alt: "the fraction 608 over 6 minus 1 equals 121.6")[$frac(608, 6 − 1) = 121.6$]. #strong[Step 6:] Take the square root of the result: #math.equation(block: false, alt: "the square root of 121.6 approximately equals 11.027")[$sqrt(121.6) ≈ 11.027$]. Thus, the standard deviation is #math.equation(block: false, alt: "s approximately equals 11.027")[$s ≈ 11.027$]. ] ] The computation for the standard deviation is complicated, even for just a small dataset. We’d never want to compute it without technology for a large dataset! Luckily, technology makes this calculation easy. #notebox("Video", rgb("#DC2626"), rgb("#DC2626"), rgb("#f7f8fa"))[ #link("https://openstax.org/r/StanDev_Google-Sheet")[Find the Standard Deviation Using Google Sheets] ] #examplebox("Example 4")[Finding the Standard Deviation with Google Sheets][ The data in #link("https://openstax.org/r/Chapter8_Data-Sets")[“AvgSAT”] contains the average SAT score for students attending every institution of higher learning in the US for which data is available. What is the standard deviation of these average SAT scores? #solutionbox[ To find the standard deviation, we click in an empty cell in our spreadsheet and then type “=STDEV(”. Next, click on the letter at the top of the column containing our data; this will put a reference to that column into our formula. Then close the parentheses with and hit the enter key. The formula is replaced with the result: 125.517. ] ] === Key Terms - range - standard deviation === Key Concepts - The range of a dataset is the difference between its largest and smallest values. The standard deviation is approximately the mean difference (in absolute value) that individual units fall from the mean of the dataset. === Formulas #math.equation(block: true, alt: "s equals the square root of the fraction ∑ open parenthesis x minus x ¯ close parenthesis squared over n minus 1")[$s = sqrt(frac(display(∑ attach(( x − overline(x) ), t: 2)), n − 1))$] Here, #emph[s] is the standard deviation, #math.equation(block: false, alt: "x")[$x$] represents each data value, #math.equation(block: false, alt: "x ¯")[$overline(x)$] is the mean of the data values, #math.equation(block: false, alt: "n")[$n$] is the number of data values, and the capital sigma (#math.equation(block: false, alt: "Σ")[$upright(Σ)$]) indicates that we take a sum. === Videos - #link("https://openstax.org/r/Finding-Minimum-and-Maximum")[Find the Minimum and Maximum Using Google Sheets] - #link("https://openstax.org/r/Finding-Standard-Deviation")[Find the Standard Deviation Using Google Sheets]