#set document(title: "8.4 Hypothesis Test for One Proportion", 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")) == 8.4#h(0.6em)Hypothesis Test for One Proportion When you read a question, it is essential that you correctly identify the parameter of interest. The parameter determines which model to use. Make sure that you can recognize and distinguish between a question regarding a population mean and a question regarding a population proportion. The z-test is a statistical test for a population proportion. It can be used when #emph[np] ≥ 10 and #emph[nq] ≥ 10. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[z-Test] The formula for the#emph[test statistic] is: #math.equation(block: true, alt: "Z equals the fraction p hat minus p sub 0 over the square root of open parenthesis the fraction p sub 0 q sub 0 over n close parenthesis .")[$Z = frac(hat(p) − p_(0), sqrt(( frac(p_(0) q_(0), n) ))) .$] where #math.equation(block: false, alt: "n")[$n$] is the sample size #math.equation(block: false, alt: "p hat equals the fraction x over n")[$hat(p) = frac(x, n)$] is the sample proportion (sometimes already given as a %) and #math.equation(block: false, alt: "p sub 0")[$p_(0)$] is the hypothesized population proportion, #math.equation(block: true, alt: "q sub 0 equals 1 – p sub 0.")[$q_(0) = 1 – p_(0) .$] ] Use the phrases in Figure 8-24 to help with setting up the hypotheses. #figure(figph[Hypothesis testing table for proportions with three columns: two-tailed test (H0: p = p0, H1: p ≠ p0, both tails shaded), right-tailed test (H1: p \> p0, right tail shaded), and left-tailed test (H1: p \< p0, left tail shaded), each with a normal curve. Below are common phrases for claims in the null hypothesis under =, ≤, and ≥ (is equal to, is at most, is at least) and in the alternative hypothesis under ≠, \>, and \< (is different from, more than, less than, decreased).], alt: "Hypothesis testing table for proportions with three columns: two-tailed test (H0: p = p0, H1: p ≠ p0, both tails shaded), right-tailed test (H1: p > p0, right tail shaded), and left-tailed test (H1: p < p0, left tail shaded), each with a normal curve. Below are common phrases for claims in the null hypothesis under =, ≤, and ≥ (is equal to, is at most, is at least) and in the alternative hypothesis under ≠, >, and < (is different from, more than, less than, decreased).", caption: none) Figure 8-24 Note we will not be using the t-distribution with proportions. We will use a standard normal z distribution for testing a proportion since this test uses the normal approximation to the binomial distribution (never use the t-distribution). If you are doing a left-tailed z-test the critical value will be negative. If you are performing a right-tailed z-test the critical value will be positive. If you were performing a two-tailed z-test then your critical values would be ±critical value. The p-value will always be a positive number between 0 and 1. The most important step in any method you use is setting up your null and alternative hypotheses. The critical values and p-value can be found using a standard normal distribution the same way that we did for the one sample z-test. #examplebox("Example 1")[][ It has been found that 85.6% of all enrolled college and university students in the United States are undergraduates. A random sample of 500 enrolled college students in a particular state revealed that 420 of them were undergraduates. Is there sufficient evidence to conclude that the proportion differs from the national percentage? Use #math.equation(block: false, alt: "α")[$α$] = 0.05. Show that all three methods of hypothesis testing yield the same results. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Finish the undergraduate proportion test] The test statistic is z = -1.019. The first link opens the standard normal with the area below it already computed; the alternative is two-tailed, so double the 0.1541 on screen to get the p-value 0.3082, exactly the double-the-tail step the book describes. The other two links are the same test's critical values. Retype the bound as -1.5831 for exercise 43. - P(Z \< -1.019) = 0.1541 - double it for the p-value 0.3082 - Critical value invNorm(0.025) = -1.96 - Critical value invNorm(0.975) = 1.96 ] #solutionbox[ At this point you should be more comfortable with the steps of a hypothesis test and not have to number each step, but know what each step means. #strong[Critical Value Method] #strong[Step 1:] State the hypotheses: The key words in this example, “proportion” and “differs,” give the hypotheses: H#sub[0]: p = 0.856 H#sub[1]: p ≠ 0.856 (claim) #strong[Step 2:] Compute the test statistic. Before finding the test statistic, find the sample proportion #math.equation(block: false, alt: "p hat equals the fraction 420 over 500 equals 0.84")[$hat(p) = frac(420, 500) = 0.84$] and #emph[q]#sub[0] = 1 – 0.856 = 0.144. Next, compute the test statistic: #math.equation(block: true, alt: "z equals the fraction p hat minus p sub 0 over the square root of open parenthesis the fraction p sub 0 q sub 0 over n close parenthesis equals the fraction 0.84 minus 0.856 over the square root of open parenthesis the fraction 0.856 times 0.144 over 500 close parenthesis equals minus 1.019.")[$z = frac(hat(p) − p_(0), sqrt(( frac(p_(0) q_(0), n) ))) = frac(0.84 − 0.856, sqrt(( frac(0.856 · 0.144, 500) ))) = − 1.019 .$] #strong[Step 3:] Draw and label the curve with the critical values. See Figure 8-25. Use #math.equation(block: false, alt: "α")[$α$] = 0.05 and technology to compute the critical values #math.equation(block: false, alt: "z sub α / 2")[$z_(α / 2)$] and #math.equation(block: false, alt: "z sub 1 minus α / 2")[$z_(1 − α / 2)$]. Excel: #math.equation(block: false, alt: "z sub α / 2")[$z_(α / 2)$] =NORM.S.INV(0.025) = –1.96 and #math.equation(block: false, alt: "z sub 1 minus α / 2")[$z_(1 − α / 2)$] =NORM.S.INV(0.975) = 1.96. TI-Calculator: #math.equation(block: false, alt: "z sub α / 2")[$z_(α / 2)$] = invNorm(0.025,0,1) = –1.96 and #math.equation(block: false, alt: "z sub 1 minus α / 2")[$z_(1 − α / 2)$] = invNorm(0.975,0,1) = 1.96. #figure(figph[Standard normal curve with both tails shaded green beyond −1.96 and 1.96; labels read area in lower tail = α/2 = 0.025, area between = 1 − α = 0.95, and area in upper tail = α/2 = 0.025.], alt: "Standard normal curve with both tails shaded green beyond −1.96 and 1.96; labels read area in lower tail = α/2 = 0.025, area between = 1 − α = 0.95, and area in upper tail = α/2 = 0.025.", caption: none) Figure 8-25 #strong[Step 4:] State the decision. Since the test statistic is not in the shaded rejection area, do not reject H#sub[0]. #strong[Step 5:] State the summary. At the 5% level of significance, there is not enough evidence to conclude that the proportion of undergraduates in college for this state differs from the national average of 85.6%. #strong[P-value Method] The hypotheses and test statistic stay the same. H#sub[0]: p = 0.856 H#sub[1]: p ≠ 0.856 (claim) #math.equation(block: true, alt: "Z equals the fraction p hat minus p sub 0 over the square root of open parenthesis the fraction p sub 0 q sub 0 over n close parenthesis equals the fraction 0.84 minus 0.856 over the square root of open parenthesis the fraction 0.856 times 0.144 over 500 close parenthesis equals minus 1.019")[$Z = frac(hat(p) − p_(0), sqrt(( frac(p_(0) q_(0), n) ))) = frac(0.84 − 0.856, sqrt(( frac(0.856 · 0.144, 500) ))) = − 1.019$] To find the p-value we need to find the P(Z \> |1.019|) the area to the left of z = –1.019 and to the right of z = 1.019. First, find the area below (since the test statistic is negative) z = –1.019 using the normalcdf we get 0.1541. Then, double this area to get the p-value = 0.3082. #figure(figph[TI-84 home screen computing normalcdf(−1E99,−1.019,0,1) = .1541014962, then Ans\*2 = .3082029924.], alt: "TI-84 home screen computing normalcdf(−1E99,−1.019,0,1) = .1541014962, then Ans*2 = .3082029924.", caption: none) Since the p-value \> #math.equation(block: false, alt: "α")[$α$] the decision is to not reject H#sub[0]. Summary: There is not enough evidence to conclude that the proportion of undergraduates in college for this state differs from the national average of 85.6%. There is a shortcut for this test on the TI Calculators, which will quickly find the test statistic and p-value. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The rejection rule for the two methods are: - P-value method: reject H#sub[0] when the p-value ≤ #math.equation(block: false, alt: "α")[$α$]. - Critical value method: reject H#sub[0] when the test statistic is in the critical region. ] ] ] #strong[TI-84:] Press the \[STAT\] key, arrow over to the \[TESTS\] menu, arrow down to the option \[5:1-PropZTest\] and press the \[ENTER\] key. Type in the hypothesized proportion (#emph[p]#sub[0]), x, sample size, arrow over to the #math.equation(block: false, alt: "not equal to")[$≠$], \<, \> sign that is the same in the problem’s alternative hypothesis statement then press the \[ENTER\] key, arrow down to \[Calculate\] and press the \[ENTER\] key. #figure(figph[Three TI-84 screens for a one-proportion z-test: the TESTS menu with 5:1-PropZTest highlighted, the input screen with p0 = .856, x = 420, n = 500 and prop ≠ p0 highlighted, and the results screen showing prop ≠ .856, z = −1.019029734, p = .3081888764, p̂ = .84, n = 500.], alt: "Three TI-84 screens for a one-proportion z-test: the TESTS menu with 5:1-PropZTest highlighted, the input screen with p0 = .856, x = 420, n = 500 and prop ≠ p0 highlighted, and the results screen showing prop ≠ .856, z = −1.019029734, p = .3081888764, p̂ = .84, n = 500.", caption: none) The calculator returns the z-test statistic and the p-value. Note: sometimes you are not given the x value but a percentage instead. To find the x to use in the calculator, multiply #math.equation(block: false, alt: "p hat")[$hat(p)$] by the sample size and round off to the nearest integer. The calculator will give you an error message if you put in a decimal for x or n. For example, if #math.equation(block: false, alt: "p hat")[$hat(p)$]= 0.22 and#emph[n] = 124 then 0.22\*124 = 27.28, so use x = 27. #strong[TI-89:] Go to the \[Apps\] #strong[Stat/List Editor], then press \[2nd\] then F6 \[Tests\], then select #strong[5: 1-PropZ-Test]. Type in the hypothesized proportion (p0), x, sample size, arrow over to the #math.equation(block: false, alt: "not equal to")[$≠$], \<, \> sign that is the same in the problem’s alternative hypothesis statement then press the \[ENTER\] key to calculate. The calculator returns the z-test statistic and the p-value. Note: sometimes you are not given the x value but a percentage instead. To find the x value to use in the calculator, multiply #math.equation(block: false, alt: "p hat")[$hat(p)$] by the sample size and round off to the nearest integer. The calculator will give you an error message if you put in a decimal for x or n. For example, if #math.equation(block: false, alt: "p hat")[$hat(p)$] = 0.22 and n = 124 then 0.22\*124 = 27.28, so use x = 27.