#set document(title: "3.3 Measures of Placement", author: "Rachel Webb") #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")) == 3.3#h(0.6em)Measures of Placement === 3.3.1 Z-Scores A #strong[z-score] is the number of standard deviations an observation x is above or below the mean. Z-scores are used to compare placement of a value compared to the mean. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ If x is an observation from a sample then the standardized value of x is the z-score where z = #math.equation(block: false, alt: "the fraction x minus x bar over s")[$frac(x − overline(x), s)$] If x is an observation from a population then the standardized value of x is the z-score where z = #math.equation(block: false, alt: "the fraction x minus μ over σ")[$frac(x − μ, σ)$] ] If the z-score is negative, x is less than the mean. If the z-score is positive, x is greater than the mean. There are no shortcuts on the calculator in Excel for z-score, but you can find s and #math.equation(block: false, alt: "x bar")[$limits(x)^(―)$] then simply subtract and divide. The number of standard deviations that a data value is from the mean is frequently used when comparing position of values. If a z-score is zero, then the data value is the same as the mean. If the z-score is one, then the data value x is one standard deviation above the mean. If the z-score is –3.5, then the data value is three and a half standard deviations below the mean. The shaded area in Figure 3-20 represents one standard deviation from the mean. #figure(figph[Normal curve over an axis running from −3 to 3 with the region between 0 and 1 shaded and labeled σ = 1, representing the area within one standard deviation above the mean.], alt: "Normal curve over an axis running from −3 to 3 with the region between 0 and 1 shaded and labeled σ = 1, representing the area within one standard deviation above the mean.", caption: none) Figure 3-20 #examplebox("Example 1")[][ For a random sample, the mean time to make a cappuccino is 2.8 minutes with a standard deviation of 0.86 minutes. Find the z-score for someone that makes their cappuccino in 4.95 minutes. #solutionbox[ z = #math.equation(block: false, alt: "the fraction x minus x bar over s")[$frac(x − overline(x), s)$] = #math.equation(block: false, alt: "the fraction 4.95 minus 2.8 over 0.86")[$frac(4.95 − 2.8, 0.86)$] = 2.5. Their time is 2.5 standard deviations above average. ] ] #examplebox("Example 2")[][ On a math test, a student scored 45. The class average was 50 with a standard deviation of 3. The same student scored an 80 on a history test, and the class average was 85 with a standard deviation of 2.5. Which exam did the student perform better on compared with the rest of the class? #solutionbox[ #math.equation(block: false, alt: "z sub m")[$z_(m)$] = #math.equation(block: false, alt: "the fraction 45 minus 50 over 3")[$frac(45 − 50, 3)$] = -1.67 $#h(1em)$ #math.equation(block: false, alt: "z sub h")[$z_(h)$] = #math.equation(block: false, alt: "the fraction 80 minus 85 over 2.5")[$frac(80 − 85, 2.5)$] =-2 Test scores are “better” when they are larger, so whichever has the largest z-score did better. The student did better on the math test than the history test, compared to the rest of the class. Be careful with the word “better,” depending on the context, better may be smaller rather than larger. For example, golf scores, time running a race, and cholesterol levels would be better if they were smaller values. ] ] #examplebox("Example 3")[][ The length of a human pregnancy has a mean of 272 days. A pregnancy lasting 281 days or more has a z-score of one. How many standard deviations above the mean is a pregnancy lasting 281 days or more? #solutionbox[ One, since by definition the z-score is the number of standard deviations from the mean. ] ] #examplebox("Example 4")[][ The length of a human pregnancy has a mean of 272 days. A pregnancy lasting 281 days or more has a z-score of one. What is the standard deviation of human pregnancy length? #solutionbox[ We know the z-score = 1 and mean = 272. Replace these two numbers in the z-score formula then solve for the standard deviation. 1 = #math.equation(block: false, alt: "the fraction 281 minus 272 over σ")[$frac(281 − 272, σ)$] $#h(1em)$ #math.equation(block: false, alt: "⇒")[$⇒$] $#h(1em)$ 1 = #math.equation(block: false, alt: "the fraction 9 over σ")[$frac(9, σ)$] $#h(1em)$ #math.equation(block: false, alt: "⇒")[$⇒$] $#h(1em)$ #math.equation(block: false, alt: "σ")[$σ$] = 9 ] ] === 3.3.2 Percentiles Along with the center and variability, another useful numerical measure is the ranking of a number. A #strong[percentile]is a measure of ranking. It represents a location measurement of a data value to the rest of the values. Many standardized tests give the results as a percentile. Doctors use percentiles graphs to show height and weight standards. #strong[Interpreting Percentiles] The p th percentile is the value that separates the bottom p% from the upper (100 – p)% of the ordered (smallest to largest) data. For example, the 75th percentile is the value that separates the bottom 75% from the upper 25% of the data. There are several methods used to find percentiles. You may get different percentile values depending on which software or calculator you use. For example, Excel has two methods, both of which are not the same method as the TI calculators. #examplebox("Example 5")[][ What does a score of the 90#super[th] percentile represent? #solutionbox[ This means that 90% of the scores were at or below this score. (A person did the same as or better than 90% of the test takers.) ] ] #examplebox("Example 6")[][ What does a score of the 70th percentile represent? #solutionbox[ This means that 70% of the scores were at or below this score. ] ] #strong[Percentile versus Score] If the test was out of 100 points and you scored at the 80#super[th] percentile, what was your score on the test? You do not know! All you know is that you scored the same as or better than 80% of the people who took the test. If all the scores were low, you could have still failed the test. On the other hand, if many of the scores were high you could have gotten a 95% or so. #strong[Note there is more than one method to find percentiles. This rounding rule in Excel is not the same as used on your TI calculators.] #strong[Finding a Percentile:] Step 1: Arrange the data in order from lowest to highest. Step 2: Substitute into the formula i= #math.equation(block: false, alt: "the fraction open parenthesis n plus 1 close parenthesis times p over 100")[$frac(( n + 1 ) · p, 100)$] where n = sample size and p = percentile. Step 3A: If i is a whole number, count out i places from the lowest number to find the percentile. For example, if you get i = 3, then the 3rd value is the percentile. Step 3B: If i is not a whole number, then take the weighted average between the i#super[th] and i#super[th] +1 data value as the percentile. For example, if i = 3.25, this would be 25% of the distance between the 3#super[rd] and the 4#super[th] data values as the percentile. Percentile = i#super[th] data value + (i#super[th] + 1 data value – i#super[th] data value)\*(0.\#\#) where \#\# is the remainder percent. #examplebox("Example 7")[][ Compute the 10#super[th] percentile of the random sample of 13 ages: 15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53, and 95. #solutionbox[ Data is already ordered, so next find i= #math.equation(block: false, alt: "the fraction open parenthesis n plus 1 close parenthesis times p over 100 equals the fraction 14 times 10 over 100")[$frac(( n + 1 ) · p, 100) = frac(14 · 10, 100)$] = 1.4. Since i is not a whole number use Step 3B, take the weighted average of 40% of the way between the 1#super[st] and 2#super[nd] values. This would be 15 + (18 – 15)∙0.4 = 16.2 and this is your 10#super[th] percentile, P#sub[#super[10]] = 16.2. ] ] In Excel use =PERCENTILE.EXC(array, k) where array is the cell reference to where the data is located and k is the percentile as a decimal between 0 and 1. Note you do not have to sort the data prior to typing it in to Excel. For this example, if you type in the data into column A, then use the formula =PERCENTILE.EXC(A1:A13, 0.1) = 16.2. #figure(figph[Excel worksheet with the header Age and ages 15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53, and 95 in cells A2 through A14; cell C2 contains the formula =PERCENTILE.EXC(A2:A14,0.1).], alt: "Excel worksheet with the header Age and ages 15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53, and 95 in cells A2 through A14; cell C2 contains the formula =PERCENTILE.EXC(A2:A14,0.1).", caption: none) === 3.3.3 Quartiles There are special percentiles called quartiles. Quartiles are numbers that divide the data into fourths. One fourth (or a quarter) of the data falls between consecutive quartiles. There are three quartiles Q#sub[1], Q#sub[2], and Q#sub[3] that subsequently divide the ordered data into the 4 pieces of approximately equal size, or 25% each. Thus, 25% of the values are less than Q#sub[1], 25% of the data values are between Q#sub[1] and Q#sub[2], 25% of the data values are between Q#sub[2] and Q#sub[3], and 25% are of the data values are greater than Q#sub[3]. Use the dollar as an example. If we make change for a dollar, we would get four quarters to make one dollar. Hence, quarter for quartiles. #figure(figph[Four United States quarter coins in a row, illustrating that four quarters make one dollar as a memory aid for quartiles dividing data into four equal parts.], alt: "Four United States quarter coins in a row, illustrating that four quarters make one dollar as a memory aid for quartiles dividing data into four equal parts.", caption: none) To find the quartiles use the same rules as percentiles where we: 1. Arrange the observations from smallest to largest and use the previous percentile rule. 2. Then find all three quartiles. - #emph[Q#sub[1]] = first quartile = 25#super[th] percentile - #emph[Q#sub[2]] = second quartile = median = 50#super[th] percentile - #emph[Q#sub[3]] = third quartile = 75#super[th] percentile #examplebox("Example 8")[][ Compute all three quartiles for the random sample of 13 ages: 15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53, and 95. \# The book's percentile rule i = (n+1)p/100 is R's quantile type 6 (= PERCENTILE.EXC) ages \<- c(15,18,22,25,26,31,33,35,38,46,51,53,95) quantile(ages, c(.10,.25,.50,.75), type = 6) \# -\> 16.2, 23.5, 33, 48.5 (the book's answers) quantile(ages, c(.25,.50,.75)) \# R default (type 7, Excel QUARTILE.INC) -\> 25, 33, 46 \# Different software, different rule -- the discrepancy the book itself warns about iqr \<- 48.5 - 23.5 \# IQR -\> 25 c(23.5 - 1.5\*iqr, 48.5 + 1.5\*iqr) \# fences -\> -14, 86 ... 95 is the lone outlier #solutionbox[ For the first quartile i= #math.equation(block: false, alt: "the fraction open parenthesis n plus 1 close parenthesis times p over 100")[$frac(( n + 1 ) · p, 100)$] = #math.equation(block: false, alt: "the fraction 14 times 25 over 100")[$frac(14 · 25, 100)$] = 3.5. Since i is not a whole number take the weighted average of half way between the 3#super[rd] and 4#super[th] data values 22 + (25 – 22)∙0.5 = 23.5, so #emph[Q]#emph[#sub[1]] = 23.5. In Excel you could use the percentile formula, but there is also a quartile formula: =QUARTILE.EXC(array, quartile), where array is the cell reference to the data and quartile is either 1, 2 or 3 for the 3 possible quartiles. In this example we would have =QUARTILE.EXC(A1:A13, 1) = 23.5. To find the second quartile: i = #math.equation(block: false, alt: "the fraction open parenthesis n plus 1 close parenthesis times p over 100 equals the fraction 14 times 50 over 100")[$frac(( n + 1 ) · p, 100) = frac(14 · 50, 100)$] = 7. Since i is a whole number use the 7#super[th] value for #emph[Q#sub[2]], so #emph[Q#sub[2]] = 33. Or use the Excel formula =QUARTILE.EXC(A1:A13, 2) = 33. For the third quartile, i = #math.equation(block: false, alt: "the fraction open parenthesis n plus 1 close parenthesis times p over 100 equals the fraction 14 times 75 over 100")[$frac(( n + 1 ) · p, 100) = frac(14 · 75, 100)$] = 10.5. Since i is not a whole number use the weighted average of half way between the 10#super[th] and 11#super[th] values 46 + (51 – 46)∙0.5 = 48.5. Or use the Excel formula =QUARTILE.EXC(A1:A13, 3) = 48.5, so #emph[Q#sub[3]] = 48.5. ] ] #examplebox("Example 9")[][ The high school graduating class of 2016 in Oregon had the following ACT quartile scores. Interpret what the number 26 under the Composite column represents. #figure(figph[Table of ACT quartile scores with columns English, Mathematics, Reading, Science, and Composite: Q3 (75th percentile) scores are 25, 26, 27, 25, and 26; Q2 (50th percentile) scores are 21, 21, 22, 22, and 21; Q1 (25th percentile) scores are 16, 17, 17, 18, and 17.], alt: "Table of ACT quartile scores with columns English, Mathematics, Reading, Science, and Composite: Q3 (75th percentile) scores are 25, 26, 27, 25, and 26; Q2 (50th percentile) scores are 21, 21, 22, 22, and 21; Q1 (25th percentile) scores are 16, 17, 17, 18, and 17.", caption: none) https://www.act.org/content/dam/act/unsecured/documents/P\_38\_389999\_S\_S\_N00\_ACT-GCPR\_Oregon.pdf #solutionbox[ From the report we can see that the third quartile for composite score is 26, this means that 75% of Oregon students that took the ACT exam scored 26 or below. ] ] #strong[Other Types of Percentiles] Quintiles break a data set up into five equal pieces. We will not be using these, but be aware that percentiles come in different forms. Deciles break a data set up into ten equal pieces and are found using the percentile rule. For example, the 6#super[th] decile = D6 = 60#super[th] percentile. Use the dollar as an example. If we make change for a dollar, we would get ten dimes to make one dollar. Hence, a dime might help you remember deciles. #figure(figph[Ten United States dime coins in a loose cluster, illustrating that ten dimes make one dollar as a memory aid for deciles dividing data into ten equal parts.], alt: "Ten United States dime coins in a loose cluster, illustrating that ten dimes make one dollar as a memory aid for deciles dividing data into ten equal parts.", caption: none) #examplebox("Example 10")[][ Earlier in Example 2-14, we made an ogive using Excel with the following sample of 35 ages. Use the ogive to find the age for the 8#super[th] decile. 46 47 49 25 46 22 42 24 46 40 39 27 25 30 33 27 46 21 29 20 26 25 25 26 35 49 33 26 32 31 39 30 39 29 26 #figure(figph[Excel combo chart titled Histogram: blue frequency bars for age bins 24, 29, 34, 39, 44, and 49 with heights 4, 12, 6, 4, 2, and 7, and an orange cumulative percent line on a secondary axis climbing to 100% at the 49 bin.], alt: "Excel combo chart titled Histogram: blue frequency bars for age bins 24, 29, 34, 39, 44, and 49 with heights 4, 12, 6, 4, 2, and 7, and an orange cumulative percent line on a secondary axis climbing to 100% at the 49 bin.", caption: none) Figure 3-21 #figure(figph[Excel histogram of ages with an orange cumulative percent line; dashed lines run from 80% on the secondary axis across to the curve and down to the bin labeled 44, showing how the 8th decile is read from the ogive.], alt: "Excel histogram of ages with an orange cumulative percent line; dashed lines run from 80% on the secondary axis across to the curve and down to the bin labeled 44, showing how the 8th decile is read from the ogive.", caption: none) Figure 3-22 #solutionbox[ The cumulative % represents the cumulative relative frequencies which are equivalent to the percentiles for each class. The red line is the ogive and the percentiles correspond to the vertical axis on the right side. If we wanted to know what age the 80#super[th] percentile was in the sample, we could use the ogive to get an approximate value. Starting on the right at 80% make a horizontal line until you hit the red cumulative % line, and then make a vertical line from there down to the axis to get the approximate age. See Figure 3-22. In this case, the 80#super[th] percentile = 8#super[th] decile would be approximately 44. ] ] === 3.3.4 Five Number Summary & Outliers If you record the quartiles together with the minimum and maximum values from a data set, you have five numbers. These five numbers are known as the five-number summary consisting of the minimum, the first quartile (#emph[Q#sub[1]]), the median (#emph[Q]#emph[#sub[2]]), the third quartile (#emph[Q]#emph[#sub[3]]), and the maximum (in that order). The #strong[interquartile range], IQR, is the difference between the first and third quartiles, #emph[Q#sub[1]] and #emph[Q#sub[3]]. Half of the data (50%) falls in the interquartile range. If the IQR is “large,” the data is spread out and if the IQR is “small,” the data is closer together. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The interquartile range (IQR) = #emph[Q#sub[3]] – #emph[Q#sub[1]] ] Not only does the IQR give a range of the middle 50% of the data, but is also used to determine outliers in a sample. To find these outliers we first find what are called a lower and upper limit sometimes called fences. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The lower limit, or inner fence, is #emph[Q#sub[1]] – (1.5·IQR). Any values that are less than the lower limit is considered an outlier. Similarly, the upper limit, or outer fence, is #emph[Q#sub[3]] + (1.5·IQR). Any values that are more than the upper limit are considered outliers. ] If all the numbers in the sample fall between the lower and upper limit, including the endpoints, then there are no outliers in the sample. Any values outside these limits would be considered outliers. === 3.3.5 Modified Box-and-Whisker Plot A boxplot (or box-and-whisker plot) is a graphical display of the five-number summary. A boxplot can be drawn vertically or horizontally. The modified boxplot shows outliers, whereas a regular boxplot does not show outliers. The basic format of the plot is a box drawn from Q1 to Q3, a vertical line drawn inside the box for the median, and horizontal lines (called whiskers) extending out of the middle of each end of the box to the minimum and maximum. The box should not touch the number line. The modified boxplot extends the left line to the smallest value greater than the lower fence, and extends the right line to the largest value less than the upper fence. Dots, circles or asterisks represent any outlier. We will make modified boxplots for this course. Like always, label the tick marks on the number line and give the graph a title. A #strong[boxplot]is a graph of the 5-number summary, see Figure 3-23. #figure(figph[Boxplot diagram over a number line labeled x: the box spans Q1 to Q3 with a dividing line at Q2, whiskers extend out to values labeled Min and Max, and an asterisk beyond each whisker is labeled Outlier.], alt: "Boxplot diagram over a number line labeled x: the box spans Q1 to Q3 with a dividing line at Q2, whiskers extend out to values labeled Min and Max, and an asterisk beyond each whisker is labeled Outlier.", caption: none) Figure 3-23 It is important to note that when you are making the boxplot the limits for finding outliers are not graphed in the plot, they were only used to find the outliers. The whiskers would go to the next largest (or smallest) value in the data set after you removed the outlier(s). If the sample has a symmetrical distribution, then the boxplot will be visibly symmetrical. If the data distribution has a left skew or a right skew, the line on that side of the boxplot will be visibly long in the direction of skewness. If the four quartiles are all about the same distance apart, then the data are likely a near uniform distribution. If a boxplot is symmetrical, and both outside lines are noticeably longer than the #emph[Q#sub[1]] to median and median to #emph[Q#sub[3]] distance, the distribution is then probably bell-shaped. #examplebox("Example 11")[][ Make a modified box-and-whisker plot for the random sample of 13 ages: 15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53, and 95. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Draw the modified boxplot live] Choose Box Plot and plot L1: the outlier 95 is drawn as its own point and the right whisker stops at 53 - a one-sided outlier means right skew. Note Crunch draws Excel QUARTILE.INC-style box edges (25 to 46), slightly inside the book's PERCENTILE.EXC values 23.5 and 48.5; the outlier and the skew conclusion are identical. - Modified boxplot of the 13 ages (outlier: 95) ] #solutionbox[ Use Excel to compute the three quartiles as: #emph[Q#sub[1]] =QUARTILE.EXC(A1:A13, 1) = 23.5 #emph[Q#sub[2]] =QUARTILE.EXC(A1:A13, 2) = 33 #emph[Q#sub[3]] =QUARTILE.EXC(A1:A13, 3) = 48.5. The 5-number summary values are 15, 23.5, 33, 48.5 and 95. Each of these numbers will need to be incorporated into the box-and-whisker plot, and any outliers to graph the modified box-and-whisker plot. To find the outliers, first find the IQR, and then find the lower and upper limits. The IQR = #emph[Q#sub[3]] – #emph[Q#sub[1]] = 48.5 – 23.5 = 25. The lower limit is #emph[Q#sub[1]] – (1.5· IQR) = 23.5 – 1.5(25) = –14. The upper limit is #emph[Q#sub[3]] + (1.5· IQR) = 48.5 + 1.5(25) = 86. Any value in our data set that is not between the lower and upper limits \[–14, 86\] is an outlier. By observation, we have one number that is outside the range so the outlier is 95. The whiskers would be drawn to the next largest (or smallest) value in the data set after you removed the outlier(s). For this example, the next largest value in the data set is 53. Now put that all together to get the following graph in Figure 3-24 #figure(figph[Boxplot over a number line from 10 to 90: Min = 15, Q1 = 23.5, Q2 = 33, Q3 = 48.5, and New Max = 53 label the box and whiskers, and an asterisk near 95 is labeled Outlier = 95.], alt: "Boxplot over a number line from 10 to 90: Min = 15, Q1 = 23.5, Q2 = 33, Q3 = 48.5, and New Max = 53 label the box and whiskers, and an asterisk near 95 is labeled Outlier = 95.", caption: none) Figure 3-24 ] ] The TI-calculator and newer versions of Excel will make a modified boxplot. Note that the quartile rules used in the TI calculators are slightly different then in Excel and what is presented in this content. They do not use a weighted mean between values, just half way between values. #strong[TI-84:] First, enter your data in to list 1. Next, press 2#super[nd] \> STAT PLOT, then choose the first plot. Note that your calculator may say Plot1…Off or show a different type of graph then the screenshot. Using your arrow keys, turn the plot on. Choose the modified boxplot which is the first of the two boxplot options with the small dots to the right of the whiskers representing outliers. Make sure your Xlist: is on L#sub[1], keep frequency as a one, and any mark will work, but the square shows up best. Here is screen shot from the calculator for the last example. You can use Trace on the boxplot from the TI-84 calculator below to see where each quartile, whisker and outlier are. #figure(figph[Two TI-84 screens: the Plot1 setup with On highlighted, the modified boxplot type, Xlist L1, Freq 1, and a square mark selected; and the plotted boxplot P1:L1 with an isolated square far to the right marking the outlier and the trace readout X = 53.], alt: "Two TI-84 screens: the Plot1 setup with On highlighted, the modified boxplot type, Xlist L1, Freq 1, and a square mark selected; and the plotted boxplot P1:L1 with an isolated square far to the right marking the outlier and the trace readout X = 53.", caption: none) #strong[TI-89:] Enter the data into the Stat/List editor under list 1. Press \[APP\] then scroll down to Stat/List Editor; on the older style TI-89 calculators, go into the Flash/App menu, and then scroll down the list. Make sure the cursor is in the list, not on the list name, and type the desired values pressing \[ENTER\] after each one. To clear a previously stored list of data values, arrow up to the list name you want to clear, press \[CLEAR\], and then press enter. After you enter the data, select Press \[F2\] Plots, scroll down to \[1: Plot Setup\] and press \[Enter\]. Then select \[F1\] Define. #figure(figph[Four TI-89 Stats/List Editor screens: the Apps screen with Stats/List Editor highlighted, the Folder Selection dialog with current folder set to main, the list editor with data values entered and the F2 Plots menu open showing 1:Plot Setup, 2:Norm Prob Plot, 3:PlotsOff, 4:FnOff, and the Plot Setup screen listing Plot 1 as defined.], alt: "Four TI-89 Stats/List Editor screens: the Apps screen with Stats/List Editor highlighted, the Folder Selection dialog with current folder set to main, the list editor with data values entered and the F2 Plots menu open showing 1:Plot Setup, 2:Norm Prob Plot, 3:PlotsOff, 4:FnOff, and the Plot Setup screen listing Plot 1 as defined.", caption: none) Use your arrow keys to select Mod Box Plot for Type, and then scroll down to the x-variable box. Press \[2#super[nd]\] \[Var-Link\] this key is above the + sign. Then arrow down until you find your List1 name under the Main file folder. Then press \[Enter\] and this will bring the name List1 back to the menu. You will now see that Plot1 has a small picture of a boxplot. To view the boxplot, press \[F5\] Zoom Data. #figure(figph[Four TI-89 screens defining a boxplot: the Define Plot 1 dialog with Plot Type menu open showing 1:Scatter, 2:xyline, 3:Box Plot, 4:Histogram, 5:Mod Box Plot; the VAR-LINK screen listing list1 through list6 under the MAIN folder; Define Plot 1 set to Mod Box Plot with Mark Box and x = list1; and the Plot Setup screen showing Plot 1 defined with x:list1.], alt: "Four TI-89 screens defining a boxplot: the Define Plot 1 dialog with Plot Type menu open showing 1:Scatter, 2:xyline, 3:Box Plot, 4:Histogram, 5:Mod Box Plot; the VAR-LINK screen listing list1 through list6 under the MAIN folder; Define Plot 1 set to Mod Box Plot with Mark Box and x = list1; and the Plot Setup screen showing Plot 1 defined with x:list1.", caption: none) #figure(figph[TI-89 graph screen displaying a horizontal boxplot labeled P1, with the trace readout maxX: 95 at the bottom of the window.], alt: "TI-89 graph screen displaying a horizontal boxplot labeled P1, with the trace readout maxX: 95 at the bottom of the window.", caption: none) Select \[F3:Trace\] to see the five-number summary and any outliers. Use the left and right arrow keys to move to the other values. #strong[Excel:] Note this example is on a PC running Excel 2019. Older versions of Excel may not have a boxplot option. First, type your sample data into column A in any order. Highlight the data, and then select the Insert tab. Under the graphing options, the picture shaped liked a histogram called statistical charts, select Box and Whisker. You can change the formatting options and add the chart title as needed. #figure(figph[Excel worksheet with Age data in column A (15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53) and the Insert tab's statistical charts menu open, highlighting Box and Whisker beneath the Histogram options; a partly visible boxplot chart titled Chart Title appears below.], alt: "Excel worksheet with Age data in column A (15, 18, 22, 25, 26, 31, 33, 35, 38, 46, 51, 53) and the Insert tab's statistical charts menu open, highlighting Box and Whisker beneath the Histogram options; a partly visible boxplot chart titled Chart Title appears below.", caption: none) Below is the finished Excel boxplot. Note that Excel does a vertical boxplot rather than the traditional horizontal number line. #figure(figph[Excel vertical boxplot titled Age with a y-axis from 0 to 100: whiskers extend from 15 to 53, the box spans roughly 24 to 48 with the median line near 33 and the mean marked by an x near 38, and a single outlier dot appears at 95.], alt: "Excel vertical boxplot titled Age with a y-axis from 0 to 100: whiskers extend from 15 to 53, the box spans roughly 24 to 48 with the median line near 33 and the mean marked by an x near 38, and a single outlier dot appears at 95.", caption: none) Excel marks an × just above the median where the mean would fall. Usually one would not include the mean on a boxplot. Remember that when the mean is greater than the median the distribution is usually skewed to the right. When a boxplot has outliers only on one side, then we can also say the distribution is skewed in the direction of the outlier, which also indicates that these ages are skewed to the right. Side by side boxplots are great at comparing quartiles and distribution shapes for several samples using the same units and scale. #examplebox("Example 12")[][ There are four franchises in different parts of town. Compare the weekly sales over a year for each of the four franchises. Compare the boxplots shown in Figure 3-25. #figure(figph[Four side-by-side vertical boxplots titled Weekly Sales (\$1,000) comparing Stores 1 through 4 on a scale of 0 to 20: Store 1's box spans about 5 to 10 with whiskers 2 to 14; Store 2 sits highest with a box of about 13 to 17 and whiskers 11 to 18; Store 3's box spans about 5.5 to 13 with whiskers 2 to 15; Store 4's box spans about 6.5 to 12.5 with whiskers 2 to 15. Means are marked with an x.], alt: "Four side-by-side vertical boxplots titled Weekly Sales ($1,000) comparing Stores 1 through 4 on a scale of 0 to 20: Store 1's box spans about 5 to 10 with whiskers 2 to 14; Store 2 sits highest with a box of about 13 to 17 and whiskers 11 to 18; Store 3's box spans about 5.5 to 13 with whiskers 2 to 15; Store 4's box spans about 6.5 to 12.5 with whiskers 2 to 15. Means are marked with an x.", caption: none) Figure 3-25 #solutionbox[ We can see that Store 2 in Figure 3-25 has the highest sales since the median for this store is higher than the third quartile for all the other stores. Store 2 also has sales that are more consistent from week to week with the smaller range and has a symmetric distribution. The lowest performing store, Store 1, has the lowest median sales and is skewed to the right. Both Stores 3 and 4 have moderate sales and are skewed left ] ] === 3.3.6 Empirical Rule Before looking at the process for computing probabilities, it is somewhat useful to look at the Empirical Rule which gives the approximate proportion of data points under a bell-shaped curve between two points. The Empirical Rule is just an approximation, more precise methods for finding these proportions will be demonstrated in later sections. #strong[The Empirical Rule should only be used with bell-shaped data.] #figure(figph[Small blue clip-art bell, echoing the bell shape of distributions to which the Empirical Rule applies.], alt: "Small blue clip-art bell, echoing the bell shape of distributions to which the Empirical Rule applies.", caption: none) #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #strong[The Empirical Rule] (also called the 68-95-99.7 Rule) In a bell-shaped distribution with mean μ and standard deviation σ, - Approximately 68% of the observations fall within 1 standard deviation (σ) of the mean μ. - Approximately 95% of the observations fall within 2 standard deviations (2σ) of the mean μ. - Approximately 99.7% of the observations fall within 3 standard deviations (3σ) of the mean μ. ] Note that we are using notation for the population mean μ and the population standard deviation σ, but the rule would also work using the sample mean and sample standard deviation. #figure(figph[Bell-shaped normal curve illustrating the Empirical Rule, with the x-axis marked from μ−3σ to μ+3σ: brackets label 68% of observations within one standard deviation of the mean, 95% within two, and 99.7% within three, with the corresponding regions shaded.], alt: "Bell-shaped normal curve illustrating the Empirical Rule, with the x-axis marked from μ−3σ to μ+3σ: brackets label 68% of observations within one standard deviation of the mean, 95% within two, and 99.7% within three, with the corresponding regions shaded.", caption: none) Figure 3-26 #examplebox("Example 13")[][ In 2009 the average SAT mathematics score was 501, with a standard deviation of 116. Assume that SAT scores are bell-shaped. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Check the Empirical Rule against exact areas] Both links open the Normal(501, 116) model behind the worked example - the Empirical Rule's 95% and 16% are approximations to these exact areas. Change the bounds to 385 and 617 to check the 68% part too (exact: 0.6827). - Rule says ~95%: exact P(269 \< X \< 733) = 0.9545 - Rule says ~16%: exact P(X \>= 617) = 0.1587 ] a) Approximately what proportion of students scored between 269 and 733 on the 2009 SAT mathematics test? b) Approximately what proportion of students scored between 385 and 617 on the 2009 SAT mathematics test? c) Approximately what proportion of students scored at least 617 on the 2009 SAT mathematics test? #solutionbox[ a) The key word is bell shaped so we can use the Empirical Rule. Start by finding the z-scores z = #math.equation(block: false, alt: "the fraction x minus μ over σ")[$frac(x − μ, σ)$] for both endpoints given in the question. A z-score by definition is the number of standard deviations a data value is from the mean. #figure(figph[Standard normal curve with the region between z = −2 and z = 2 shaded and labeled 0.95, on an axis from −3 to 3; above it are the calculations z = (269 − 501)/116 = −2 and z = (733 − 501)/116 = 2.], alt: "Standard normal curve with the region between z = −2 and z = 2 shaded and labeled 0.95, on an axis from −3 to 3; above it are the calculations z = (269 − 501)/116 = −2 and z = (733 − 501)/116 = 2.", caption: none) Figure 3-27 The two z-scores show that the test scores of 269 and 733 are two standard deviations from the mean. Using the second bulleted item in the Empirical Rule the answer would be approximately 95% of the math SAT scores will fall between 269 and 733. b) Take the z-scores of the endpoints to get: z=#math.equation(block: false, alt: "the fraction 385 minus 501 over 116 equals minus 1 , z equals the fraction 617 minus 501 over 116 equals 1")[$frac(385 − 501, 116) = − 1 , z = frac(617 − 501, 116) = 1$] #figure(figph[Standard normal curve with the region between z = −1 and z = 1 shaded and labeled 0.68, on an axis running from −3 to 3.], alt: "Standard normal curve with the region between z = −1 and z = 1 shaded and labeled 0.68, on an axis running from −3 to 3.", caption: none) Figure 3-28 The two z-scores show that the test scores of 385 and 617 are one standard deviation from the mean. Using the first bulleted item in the Empirical Rule the answer would be approximately 68% of the math SAT scores will fall between 385 and 617. c): Start by taking the z-score of 617, we get z = #math.equation(block: false, alt: "the fraction 617 minus 501 over 116")[$frac(617 − 501, 116)$] = 1. Since a bell-shaped curve is symmetric and we can assume that 100% of the population is represented then we can subtract the middle from the whole to get 100% – 68% = 32%. If we divide this outside area by two, #math.equation(block: false, alt: "the fraction 32 over")[$32$] = 16%, we would expect 16% in each tail area. See Figure 3-29. #figure(figph[Standard normal curve with the middle region between z = −1 and z = 1 lightly shaded and labeled 0.68, each tail labeled 0.16, and the right tail beyond z = 1 shaded with crosshatching.], alt: "Standard normal curve with the middle region between z = −1 and z = 1 lightly shaded and labeled 0.68, each tail labeled 0.16, and the right tail beyond z = 1 shaded with crosshatching.", caption: none) Figure 3-29 The answer would be approximately 16% of students scored at least 617 on the 2009 SAT mathematics test. ] ] If you were to get a z-score that is not –3, –2, –1, 1, 2 or 3 then you would not be able to apply the Empirical Rule. We also need to ensure that our population has a bell-shaped curve before using the Empirical Rule. === 3.3.7 Chebyshev’s Theorem One way of estimating the proportion of values from any data set within a certain number of standard deviations is Chebyshev’s Theorem. Pafnuty Chebyshev (Чебышёва) was a Russian mathematician who proved several important theorems. One that we will use for this chapter is called Chebyshev’s Inequality. The Empirical Rule only works for bell-shaped distributions. However, we can use Chebyshev’s Inequality for any distribution shape. #figure(figph[Black-and-white portrait of Russian mathematician Pafnuty Chebyshev, a clean-shaven man with dark hair wearing a dark high-collared coat.], alt: "Black-and-white portrait of Russian mathematician Pafnuty Chebyshev, a clean-shaven man with dark hair wearing a dark high-collared coat.", caption: none) #link("https://mathshistory.st-andrews.ac.uk/Biographies/Chebyshev/")[Chebyshev] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #strong[Chebyshev’s Inequality:] The proportion (percent or fraction) of values from a data set that will fall within k standard deviations of the mean will be at least #math.equation(block: false, alt: "open parenthesis open parenthesis 1 minus the fraction 1 over open parenthesis z close parenthesis squared close parenthesis times 100 close parenthesis")[$( ( 1 − frac(1, ( z )^(2)) ) · 100 )$] % , where z is a real number that has an absolute value greater than 1 (z is not necessarily an integer). ] #examplebox("Example 14")[][ The average number of acres for farms in a certain country is 443 with a standard deviation of 42 acres. At least what percent of farms will have between 338 and 548 acres? #solutionbox[ The question gives no indication for the distribution shape for number of farm acres so we will use Chebyshev’s Inequality instead of the Empirical Rule. The easiest way to start is to find the z-score of the lower and upper bounds given in the question where μ = 443 and σ = 42. z = #math.equation(block: false, alt: "the fraction 338 − 443 over 42")[$frac(338 − 443, 42)$] = −2.5 and z = #math.equation(block: false, alt: "the fraction 548 − 443 over 42")[$frac(548 − 443, 42)$] = 2.5 Use either z-score, but it is easier to use the positive value, and substitute into the formula: #math.equation(block: true, alt: "open parenthesis open parenthesis 1 minus the fraction 1 over open parenthesis z close parenthesis squared close parenthesis times 100 close parenthesis")[$( ( 1 − frac(1, ( z )^(2)) ) · 100 )$] At least 84% of the farms will have between 338 and 548 acres. ] ] #examplebox("Example 15")[][ The average quiz score for a statistics course is 15.2 with a standard deviation of 3.15. What are the quiz scores that would have at least 75% of the scores between? #solutionbox[ This question gives a percent and we need to work backward. We will use Chebyshev’s Inequality since there is no mention of a bell-shaped distribution. Use algebra to solve for z in the following formula #math.equation(block: false, alt: "open parenthesis open parenthesis 1 minus the fraction 1 over open parenthesis z close parenthesis squared close parenthesis times 100 close parenthesis")[$( ( 1 − frac(1, ( z )^(2)) ) · 100 )$] = 75%. Start by dividing both sides by 100% to get rid of the %. We then have 1 − #math.equation(block: false, alt: "the fraction 1 over open parenthesis z close parenthesis squared")[$frac(1, ( z )^(2))$] = 0.75. Next, add #math.equation(block: false, alt: "the fraction 1 over open parenthesis z close parenthesis squared")[$frac(1, ( z )^(2))$] to both sides of the equation and subtract 0.75 from both sides of the equation to get 0.25 = #math.equation(block: false, alt: "the fraction 1 over open parenthesis z close parenthesis squared")[$frac(1, ( z )^(2))$]. Multiply both sides by z#super[2] , divide both sides by 0.25 and simplify to get (z)#super[2] = #math.equation(block: false, alt: "the fraction 1 over 0.25")[$frac(1, 0.25)$] $#h(1em)$ #math.equation(block: false, alt: "⇒")[$⇒$] $#h(1em)$ z#super[2] = 4. Take the square root of both sides #math.equation(block: false, alt: "the square root of z squared")[$sqrt(z^(2))$] = #math.equation(block: false, alt: "the square root of 4")[$sqrt(4)$] $#h(1em)$ #math.equation(block: false, alt: "⇒")[$⇒$] $#h(1em)$ = #math.equation(block: false, alt: "± 2")[$± 2$]. This means that according to Chebyshev’s Theorem at least 75% of the data will fall within two standard deviations from the mean. Next, we need to find what quiz scores are two standard deviations from the mean. Find the mean #math.equation(block: false, alt: "± 2")[$± 2$] standard deviations, by computing: \\(\\begin{aligned} #linebreak() &\\mu-2 \\cdot \\sigma=15.2-2 \\cdot 3.15=8.9 \\\\ #linebreak() &\\mu+2 \\cdot \\sigma=15.2+2 \\cdot 3.15=21.5 #linebreak() \\end{aligned}\\) At least 75% of the students scored between 8.9 and 21.5 on the quiz. ] ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The general formulas for finding the endpoints are: Lower endpoint: a = μ – z·σ Upper endpoint: b = μ + z·σ ] If the distribution of quiz scores were bell shaped we would have a larger percent (95%) between 8.9 and 21.5. Chebyshev’s Inequality assumes the distribution is skewed and says “at least” which would then also be correct if more students fell within the range. Since Chebyshev’s Inequality works for any shape of a distribution we should only use if between two values, not strictly below or above a point. If we were interested in below a certain point, we would not know if we had the fat or skinny tail of a skewed distribution. The following picture shows a positively skewed distribution with 1.5 standard deviations from the mean shaded in red. Chebyshev’s Inequality would guarantee at least #math.equation(block: false, alt: "open parenthesis open parenthesis 1 minus the fraction 1 over open parenthesis 1.5 close parenthesis squared close parenthesis times 100 close parenthesis")[$( ( 1 − frac(1, ( 1.5 )^(2)) ) · 100 )$] = 56% of the data in the shaded area would fall within 1.5 standard deviations from the mean. #figure(figph[Positively skewed distribution curve with a long right tail; the region from μ − 1.5σ to μ + 1.5σ is shaded red, with blue vertical lines marking μ − 1.5σ, the mean μ, and μ + 1.5σ.], alt: "Positively skewed distribution curve with a long right tail; the region from μ − 1.5σ to μ + 1.5σ is shaded red, with blue vertical lines marking μ − 1.5σ, the mean μ, and μ + 1.5σ.", caption: none) Figure 3-30 #strong[Summary:] Use the mode for nominal, ordinal, interval, and ratio data, since the mode is just the data value that occurs most often. You are just counting the data values. The median can be found on ordinal, interval, and ratio data, since you need to put the data in order. As long as there is order to the data you can find the median. The mean can be found on interval and ratio data, since you must have numbers to add together. The mean is pulled in the direction of outliers. By comparing the mean to the median, you can decide if a distribution is symmetric or skewed. The range, variance, standard deviation and coefficient of variation are used to measure how spread out a data set is from the middle. When comparing two data sets with different units or scale use the coefficient of variation. Z-scores tell you how many standard deviations a data point is away from the mean. Quartiles are special percentiles that are used to find the interquartile range, identify outliers, and make a box-and-whisker plot. Use the Empirical Rule when finding the proportion of a sample or population that fall within 1, 2 or 3 standard deviations on a bell-shaped curve. If the distribution is bell shaped then the Empirical Rule states that approximately 68% of the data will fall within one standard deviation, 95% within two standard deviations and 99.7% within three standard deviations. If you do not know the distribution shape, then use Chebyshev’s Inequality to find the minimum proportion within |z| \> 1 standard deviations from the mean.