#set document(title: "13.2 Sign Test", 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")) == 13.2#h(0.6em)Sign Test The sign test can be used for both one sample or for two dependent groups. The sign test uses a Binomial Distribution and looks at the probability of a success as 50%. The median is the 50th percentile, so many times we will state our null hypothesis as the median is equal to a certain value. However, sometimes we will state the hypothesis in terms of a proportion. #figure(table( columns: 3, align: left, inset: 6pt, table.header([Two-Tailed Test], [Right-Tailed Test], [Left-Tailed Test]), [#math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Median #math.equation(block: false, alt: "equals MD sub 0")[$= "MD"_(0)$] #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Median #math.equation(block: false, alt: "not equal to MD sub 0")[$≠ "MD"_(0)$]], [#math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Median #math.equation(block: false, alt: "equals MD sub 0")[$= "MD"_(0)$] #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Median #math.equation(block: false, alt: "greater than MD sub 0")[$> "MD"_(0)$]], [#math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Median #math.equation(block: false, alt: "equals MD sub 0")[$= "MD"_(0)$] #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Median #math.equation(block: false, alt: "less than MD sub 0")[$< "MD"_(0)$]], )) #math.equation(block: false, alt: "MD sub 0")[$"MD"_(0)$] is a placeholder for the number for the hypothesized median. === The Sign Test Procedure For the single-sample test, compare each value with the conjectured median. If a data value is larger than the hypothesized median, replace the value with a positive sign. If a data value is smaller than the hypothesized median, replace the value with a negative sign. If the data value equals the hypothesized median, replace the value with a 0. The sample size is the number of plus and minus signs added together (do not include data values that tie with the median). For the paired-sample sign test, subtract the group 2 values from the group 1 values and indicate the difference with a positive or negative sign, or 0 (if they tie) and #math.equation(block: false, alt: "n")[$n$] = total number of positive and negative signs (do not include differences of zero). Use the binomial distribution to find the p-value using technology. - For a two-tailed test, the test statistic, #math.equation(block: false, alt: "x")[$x$], is the smaller of the plus or minus signs. If #math.equation(block: false, alt: "x")[$x$] is the test statistic, the p-value for a two-tailed test is the #math.equation(block: false, alt: "2 times P open parenthesis X less than or equal to x close parenthesis")[$2 · "P" ( X ≤ x )$]. - For a right-tailed test, the test statistic, #math.equation(block: false, alt: "x")[$x$], is the number of plus signs. For a left-tailed test, the test statistic, #math.equation(block: false, alt: "x")[$x$], is the number of minus signs. The p-value for a one-tailed test is the #math.equation(block: false, alt: "P open parenthesis X greater than or equal to x close parenthesis")[$"P" ( X ≥ x )$]. The sign test is an alternative to the one sample t-test when you have a small sample size, but the population is not normally distributed. The sign test is also an alternative to the paired sample t-test when you have a small sample size and the difference in the pairs is not normally distributed. The sign test does not detect the magnitude of the difference between the hypothesized value and is not as efficient as the t-test. #examplebox("Example 1")[][ A student tells her parents that the median rental rate for a studio apartment in Portland is \$700. Her parents are skeptical and believe the rent is different. A random sample of studio rentals is taken from the internet; prices are listed below. Test the claim that there is a difference using #math.equation(block: false, alt: "α")[$α$] = 0.10. Should the parents believe their daughter? #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[The sign test is a binomial in disguise] Once the signs are counted (18 plus, 2 minus, so n = 20 and test statistic x = 2), the p-value is one binomial read. The link opens Binomial(n = 20, p = 0.5) with the cumulative already computed at k = 2; double it for the two-tailed p-value. Move k to 3, then 4, and watch how quickly the tail stops being extreme. - P(X \<= 2) = 0.000201, doubled = 0.000402 ] 700 650 800 975 855 785 759 640 950 715 825 980 895 1025 850 915 740 985 770 785 700 925 #solutionbox[ 1. The hypotheses for this example are: #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Median #math.equation(block: false, alt: "equals 700")[$= 700$] #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Median #math.equation(block: false, alt: "not equal to 700")[$≠ 700$] 2. Find the test statistic. Compare each value to the median. If the value is below the median, then give it a negative sign; if the value is above the mean, then give it a positive sign. If the value is tied with the median, then give it a zero. #figure(table( columns: 11, align: left, inset: 6pt, table.header([700 #linebreak() 0], [650 #linebreak() -], [800 #linebreak() +], [975 #linebreak() +], [855 #linebreak() +], [785 #linebreak() +], [759 #linebreak() +], [640 #linebreak() -], [950 #linebreak() +], [715 #linebreak() +], [825 #linebreak() +]), [980 #linebreak() +], [895 #linebreak() +], [1025 #linebreak() +], [850 #linebreak() +], [915 #linebreak() +], [740 #linebreak() +], [985 #linebreak() +], [770 #linebreak() +], [785 #linebreak() +], [700 #linebreak() 0], [925 #linebreak() +], )) Count the number of positive and negative signs. Positive signs = 18, Negative signs = 2. The sample size is then #math.equation(block: false, alt: "18 plus 2 equals 20")[$18 + 2 = 20$]. The test statistic is the smaller of the number of plus or minus signs. Therefore, in this case, the test statistic is 2. 3. Using the p-value method, the p-value is #math.equation(block: false, alt: "2 times P open parenthesis X less than or equal to Test Statistic close parenthesis")[$2 · "P" ( X ≤ "Test Statistic" )$] using a binomial distribution with #math.equation(block: false, alt: "p equals 0.5")[$p = 0.5$]. With the sample size #math.equation(block: false, alt: "n equals 20")[$n = 20$] and #math.equation(block: false, alt: "p equals 0.5")[$p = 0.5$], then #math.equation(block: false, alt: "q equals 1 minus p equals 0.5")[$q = 1 − p = 0.5$]. The test statistic is #math.equation(block: false, alt: "x equals 2")[$x = 2$], so find #math.equation(block: false, alt: "2 times P open parenthesis X less than or equal to 2 close parenthesis")[$2 · "P" ( X ≤ 2 )$]. #math.equation(block: true, alt: "P open parenthesis X less than or equal to 2 close parenthesis equals P open parenthesis X equals 0 close parenthesis plus P open parenthesis X equals 1 close parenthesis plus P open parenthesis X equals 2 close parenthesis equals 20 C sub 0 times 0.5 to the power 0 times 0.5 to the power 20 plus 20 C sub 1 times 0.5 to the power 1 times 0.5 to the power 19 plus 20 C sub 2 times 0.5 squared times 0.5 to the power 18 equals 0.0000010 plus 0.0000191 plus 0.0001812 equals 0.000201.")[$"P" ( X ≤ 2 ) = "P" ( X = 0 ) + "P" ( X = 1 ) + "P" ( X = 2 ) = 20 C_(0) · 0.5^(0) · 0.5^(20) + 20 C_(1) · 0.5^(1) · 0.5^(19) + 20 C_(2) · 0.5^(2) · 0.5^(18) = 0.0000010 + 0.0000191 + 0.0001812 = 0.000201 .$] Since this is a two-tailed test, we multiply the probability by 2 to get #math.equation(block: false, alt: "2 times 0.000201 equals 0.000402")[$2 · 0.000201 = 0.000402$]. We can also use the TI-84 calculator for a two-tailed test, to get #math.equation(block: false, alt: "2 * binomcdf open parenthesis 20 , 0.5 , 2 close parenthesis equals 0.000402.")[$2 * "binomcdf" ( 20 , 0.5 , 2 ) = 0.000402 .$] #figure(figph[Selecting the binomial cdf function from the distribution menu of a TI-84 calculator.], alt: "Selecting the binomial cdf function from the distribution menu of a TI-84 calculator.", caption: none) #figure(figph[Two times the binomial cdf of the TI-84, with inputs 20, 0.5, and 2, is 0.000402.], alt: "Two times the binomial cdf of the TI-84, with inputs 20, 0.5, and 2, is 0.000402.", caption: none) The p-value = 0.000402. 4. The p-value is smaller than alpha; therefore reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. 5. There is enough evidence to support the parents’ claim that the median rent for a studio apartment in Portland is not \$700. The critical values for the sign test come from a binomial distribution when the probability of a success is 50% since the median is the 50th percentile, and the sample size is 20. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Build the rejection region one tail step at a time] Both links open Binomial(n = 20, p = 0.5), the distribution behind Figures 13-1 and 13-2. The first stops at x = 5: doubled, 0.0414 is still under alpha = 0.05. The second adds x = 6 and doubles to 0.1153, which is past alpha - so the two-tailed critical values are 5 and 15. - P(X \<= 5) = 0.020695 (doubled = 0.0414) - P(X \<= 6) = 0.057659 (doubled = 0.1153) ] If you were to calculate the discrete probability distribution for each possible value of #math.equation(block: false, alt: "x")[$x$], you would get the following discrete probability distribution table (Figure 13-1) and corresponding graph (Figure 13-2). #figure(figph[Table of discrete probability distribution for each value of x between 0 and 20. The sum of the probabilities for x=0 through x=5 is 0.0206949, and the sum of the probabilities for x=15 through x=20 is 0.0206949.], alt: "Table of discrete probability distribution for each value of x between 0 and 20. The sum of the probabilities for x=0 through x=5 is 0.0206949, and the sum of the probabilities for x=15 through x=20 is 0.0206949.", caption: [Figure 13-1: Discrete probability distribution table for each value of #math.equation(block: false, alt: "x")[$x$].]) #figure(figph[Binomial distribution bar graph for n=20, p=0.5. The bars for x=0 through x=5 and the bars for x=15 through x=20 are highlighted.], alt: "Binomial distribution bar graph for n=20, p=0.5. The bars for x=0 through x=5 and the bars for x=15 through x=20 are highlighted.", caption: [Figure 13-2: Graph of binomial distribution data from Figure 13-1, with the two tails highlighted.]) When we add up the highlighted probabilities we would get a probability of approximately #math.equation(block: false, alt: "0.0206949 plus 0.0206949 equals 0.0414")[$0.0206949 + 0.0206949 = 0.0414$], which is below our alpha 0.05 for a two-tailed test. If we were to add in the values of #math.equation(block: false, alt: "x equals 6")[$x = 6$] and #math.equation(block: false, alt: "x equals 14")[$x = 14$] we would get 0.1153, which is above our value for alpha. Figure 13-2 is a bar graph of showing the binomial distribution and shaded critical values. This means that #math.equation(block: false, alt: "x equals 5")[$x = 5$] and #math.equation(block: false, alt: "x equals 15")[$x = 15$] are the critical values for a two-tailed sign test with #math.equation(block: false, alt: "n equals 20")[$n = 20$]. If the test statistic is less than or equal to 5 or greater than or equal to 15, we would reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. The test statistic is the smaller of plus or minus signs, which is 2. Since #math.equation(block: false, alt: "2 less than or equal to 5")[$2 ≤ 5$], we would reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$], which agrees with the p-value method. If you were doing a one-tailed test you would use the probabilities for one of the tails. ] ] #examplebox("Example 2")[][ A professor believes that a new online learning curriculum is increasing the median final exam score from the previous year, which was 75. A random sample of final exam scores were collected for students that went through the new curriculum. Test to see if the new curriculum is effective using #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$]. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Read a right-tailed critical value off the binomial] Binomial(n = 11, p = 0.5) opens with the cumulative computed. The panel reports P(X \<= k), so the upper tail is 1 - P(X \<= 8) = 0.03272 from the first link. Subtract the two links to recover the book's next term, P(X = 8) = 0.96729 - 0.88672 = 0.08057; adding it would push the tail past alpha = 0.05, which is why the critical value stops at 9. - P(X \<= 8) = 0.96729, so P(X \>= 9) = 0.03272 - P(X \<= 7) = 0.88672 ] 78 100 75 64 87 80 72 91 89 70 82 76 #solutionbox[ The hypotheses are: #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Median #math.equation(block: false, alt: "equals 75")[$= 75$] #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Median #math.equation(block: false, alt: "greater than 75")[$> 75$] Find the test statistic. Compare each value to the median. If the value is below the median then give it a negative sign, if the value is above the mean then give it a positive sign. If the value is tied with the median then give it a zero. #figure(table( columns: 12, align: left, inset: 6pt, [78 #linebreak() +], [100 #linebreak() +], [75 #linebreak() 0], [64 #linebreak() -], [87 #linebreak() +], [80 #linebreak() +], [72 #linebreak() -], [91 #linebreak() +], [89 #linebreak() +], [70 #linebreak() -], [82 #linebreak() +], [76 #linebreak() +], )) Count the number of positive and negative signs. Positive signs = 8, Negative signs = 3. The sample size is then #math.equation(block: false, alt: "8 plus 3 equals 11")[$8 + 3 = 11$]. The test statistic for a right tailed test is the number of plus signs. Therefore, in this case, the test statistic is 8. To find the critical value, use technology to find the probabilities for #math.equation(block: false, alt: "x equals 0")[$x = 0$] to #math.equation(block: false, alt: "x equals 11")[$x = 11$] for a binomial distribution with #math.equation(block: false, alt: "n equals 11")[$n = 11$] and #math.equation(block: false, alt: "p equals 0.5")[$p = 0.5$]. See Figure 13-3 for the results. Since #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$], add up the areas starting at the bottom at #math.equation(block: false, alt: "x equals 11")[$x = 11$] until you get a sum of no more than 0.05. #math.equation(block: true, alt: "P open parenthesis 9 less than or equal to X less than or equal to 11 close parenthesis equals P open parenthesis X equals 9 close parenthesis plus P open parenthesis X equals 10 close parenthesis plus P open parenthesis X equals 11 close parenthesis equals 11 C sub 10 times 0.5 to the power 9 times 0.5 squared plus 11 C sub 10 times 0.5 to the power 10 times 0.5 to the power 1 plus 11 C sub 11 times 0.5 to the power 0 times 0.5 to the power 11 equals 0.03272.")[$"P" ( 9 ≤ X ≤ 11 ) = "P" ( X = 9 ) + "P" ( X = 10 ) + "P" ( X = 11 ) = 11 C_(10) · 0.5^(9) · 0.5^(2) + 11 C_(10) · 0.5^(10) · 0.5^(1) + 11 C_(11) · 0.5^(0) · 0.5^(11) = 0.03272 .$] If we add in the next value of #math.equation(block: false, alt: "P open parenthesis X equals 8 close parenthesis equals 0.08057")[$"P" ( X = 8 ) = 0.08057$], the sum would exceed 0.05, so we would stop at a critical value of #math.equation(block: false, alt: "X equals 9")[$X = 9$]. See Figure 13-4. #figure(figph[Discrete probability distribution table for values of x from 0 through 11. The sum of the probabilities for x=9, 10, and 11 is 0.03272.], alt: "Discrete probability distribution table for values of x from 0 through 11. The sum of the probabilities for x=9, 10, and 11 is 0.03272.", caption: [Figure 13-3: Discrete probability distribution table for each value of #math.equation(block: false, alt: "x")[$x$].]) #figure(figph[Bar graph of binomial distribution for n=11 and p=0.5. The bars for values of 9, 10, and 11 are highlighted.], alt: "Bar graph of binomial distribution for n=11 and p=0.5. The bars for values of 9, 10, and 11 are highlighted.", caption: [Figure 13-4: Graph of binomial distribution data from Figure 13-3, with the right tail highlighted.]) Since the test statistic #math.equation(block: false, alt: "X equals 8")[$X = 8$] is not in the rejection area, we would fail to reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. At the 5% significance level, there is not enough evidence to support the claim that there is a statistically significant difference in final exam scores for the new online curriculum. ] ] #examplebox("Example 3")[][ The median annual salary for high school teachers in the United States was \$60,320. A teacher believes that the median high school salary in Oregon is significantly less than the national median. A sample of 100 high school teacher’s salaries found that 58 were below \$60,320, 40 were above \$60,320 and 2 were \$60,320. Use #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$] to test their claim. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph["A lot of work by hand" is one cumulative read] 58 salaries below the national median and 40 above give n = 98 and x = 58. The first link opens Binomial(n = 98, p = 0.5) at k = 57, because a P(X \>= 58) tail is 1 - P(X \<= 57) = 0.0427, the book's p-value. The second link uses k = 58 instead - the argument the book's TI screenshot shows - and returns 0.0272, which is P(X \>= 59). Same distribution, one index apart. - P(X \<= 57) = 0.95729, so P(X \>= 58) = 0.0427 - P(X \<= 58) = 0.97280, so P(X \>= 59) = 0.0272 ] #solutionbox[ The hypotheses are: #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Median = \$60,320 #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Median \< \$60,320 (claim) The sample size #math.equation(block: false, alt: "n equals 58 plus 40 equals 98")[$n = 58 + 40 = 98$]. We will use #math.equation(block: false, alt: "x equals 58")[$x = 58$]. The p-value is found by taking #math.equation(block: false, alt: "P open parenthesis X greater than or equal to 58 close parenthesis")[$"P" ( X ≥ 58 )$]. This is a lot of work by hand, so use technology. For a TI-84 calculator use #math.equation(block: false, alt: "1 minus binomcdf open parenthesis 98 , 0.5 , 58 close parenthesis equals 0.0272.")[$1 − "binomcdf" ( 98 , 0.5 , 58 ) = 0.0272 .$] #figure(figph[On a TI-84 calculator, 1 minus the binomial cdf with inputs 98, 5, and 58 is 0.0271952788.], alt: "On a TI-84 calculator, 1 minus the binomial cdf with inputs 98, 5, and 58 is 0.0271952788.", caption: none) The p-value = 0.0427, which is less than #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$], so reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. There is enough evidence to support the claim that the median high school salary in Oregon is significantly less than the national median of \$60,320. ] ] #strong[The sign test can also be used for dependent samples when the assumptions for a paired t-test are not met.] #examplebox("Example 4")[][ A manufacturer believes that if routine maintenance (cleaning and oiling of machines) is increased to once a day rather than once a week, the number of defective parts produced by the machines will decrease. Nine machines are selected, and the number of defective parts produced over a 24-hour operating period is counted. Maintenance is then increased to once a day for a week, and the number of defective parts each machine produces is again counted over a 24-hour operating period. The data are shown here. At #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$], can the manufacturer conclude that the additional maintenance reduces the number of defective parts manufactured by the machines? #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[The paired sign test uses the very same binomial] Differencing Before - After gives 6 plus signs, 2 minus and one tie dropped, so n = 8 and x = 6. The link opens Binomial(n = 8, p = 0.5) at k = 5, since a right-tailed P(X \>= 6) is 1 - P(X \<= 5) = 0.1445. Slide k to 6 and the panel answers P(X \>= 7) = 0.0352 instead - a useful reminder that the cumulative always stops one below the value you want in the tail. - P(X \<= 5) = 0.85547, so P(X \>= 6) = 0.1445 ] Machine 1 2 3 4 5 6 7 8 9 Before 6 18 5 4 16 13 20 9 3 After 5 16 7 4 18 12 14 7 1 #solutionbox[ #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] The additional maintenance does not reduce the number of defective parts manufactured by the machines. #linebreak() #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] The additional maintenance reduces the number of defective parts manufactured by the machines. Next, for each pair, take #math.equation(block: false, alt: "Before minus After")[$"Before" − "After"$]. If this difference is positive then put a #math.equation(block: false, alt: "plus")[$+$] sign next to it, if the difference is negative then put a #math.equation(block: false, alt: "–")[$–$] sign next to it and if the difference is zero then put a 0 next to it. #figure(table( columns: 10, align: left, inset: 6pt, table.header([Machine], [1], [2], [3], [4], [5], [6], [7], [8], [9]), [Before], [6], [18], [5], [4], [16], [13], [20], [9], [3], [After], [5], [16], [7], [4], [18], [12], [14], [7], [1], [Sign of Difference], [#math.equation(block: false, alt: "plus")[$+$]], [#math.equation(block: false, alt: "plus")[$+$]], [#math.equation(block: false, alt: "minus")[$−$]], [0], [#math.equation(block: false, alt: "minus")[$−$]], [#math.equation(block: false, alt: "plus")[$+$]], [#math.equation(block: false, alt: "plus")[$+$]], [#math.equation(block: false, alt: "plus")[$+$]], [#math.equation(block: false, alt: "plus")[$+$]], )) Count the number of positive and negative signs. Positive signs = 6, Negative signs = 2. The sample size is then #math.equation(block: false, alt: "6 plus 2 equals 8")[$6 + 2 = 8$]. Note that this is a right-tailed test, since we are looking at “reducing” defective parts so that #math.equation(block: false, alt: "Before greater than After")[$"Before" > "After"$]. The test statistic is the number of plus signs, #math.equation(block: false, alt: "x equals 6")[$x = 6$]. #math.equation(block: false, alt: "P open parenthesis X greater than or equal to 6 close parenthesis equals P open parenthesis X equals 6 close parenthesis plus P open parenthesis X equals 7 close parenthesis plus P open parenthesis X equals 8 close parenthesis equals 8 C sub 6 times 0.5 to the power 6 times 0.5 squared plus 8 C sub 7 times 0.5 to the power 7 times 0.5 to the power 1 plus 8 C sub 8 times 0.5 to the power 8 times 0.5 to the power 0 equals 0.109375 plus 0.031250 plus 0.003906 equals 0.144531")[$"P" ( X ≥ 6 ) = "P" ( X = 6 ) + "P" ( X = 7 ) + "P" ( X = 8 ) = 8 C_(6) · 0.5^(6) · 0.5^(2) + 8 C_(7) · 0.5^(7) · 0.5^(1) + 8 C_(8) · 0.5^(8) · 0.5^(0) = 0.109375 + 0.031250 + 0.003906 = 0.144531$], which is the p-value. For a TI calculator, use #math.equation(block: false, alt: "1 minus binomcdf open parenthesis 8 , 0.5 , 6 close parenthesis equals 0.1445")[$1 − "binomcdf" ( 8 , 0.5 , 6 ) = 0.1445$]. The p-value = 0.1445, which is greater than #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$]; therefore do not reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. There is not enough evidence to support the claim that the additional maintenance reduces the number of defective parts manufactured by the machines. ] ]