#set document(title: "7.2 One-Sample Proportion Test", author: "Kathryn Kozak") #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")) == 7.2#h(0.6em)One-Sample Proportion Test There are many different parameters that you can test. There is a test for the mean, such as was introduced with the z-test. There is also a test for the population proportion, p. This is where you might be curious if the proportion of students who smoke at your school is lower than the proportion in your area. Or you could question if the proportion of accidents caused by teenage drivers who do not have a drivers’ education class is more than the national proportion. To test a population proportion, there are a few things that need to be defined first. Usually, Greek letters are used for parameters and Latin letters for statistics. When talking about proportions, it makes sense to use #emph[p] for proportion. The Greek letter for #emph[p] is #math.equation(block: false, alt: "π")[$π$], but that is too confusing to use. Instead, it is best to use #emph[p] for the population proportion. That means that a different symbol is needed for the sample proportion. The convention is to use, #math.equation(block: false, alt: "p ^")[$hat(p)$], known as p-hat. This way you know that #emph[p] is the population proportion, and that #math.equation(block: false, alt: "p ^")[$hat(p)$] is the sample proportion related to it. Now proportion tests are about looking for the percentage of individuals who have a particular attribute. You are really looking for the number of successes that happen. Thus, a proportion test involves a binomial distribution. === Hypothesis Test for One Population Proportion (1-Prop Test) + State the random variable and the parameter in words. #linebreak() #emph[x] = number of successes #linebreak() I = proportion of successes + State the null and alternative hypotheses and the level of significance #linebreak() #math.equation(block: false, alt: "H sub o : p equals p sub o")[$H_(o) : p = p_(o)$], where #math.equation(block: false, alt: "p sub o")[$p_(o)$] is the known proportion #linebreak() #math.equation(block: false, alt: "H sub A : p less than p sub o")[$H_(A) : p < p_(o)$] #linebreak() #math.equation(block: false, alt: "H sub A : p greater than p sub o")[$H_(A) : p > p_(o)$], use the appropriate one for your problem #linebreak() #math.equation(block: false, alt: "H sub A : p not equal to p sub o")[$H_(A) : p ≠ p_(o)$] #linebreak() Also, state your #math.equation(block: false, alt: "α")[$α$] level here. + State and check the assumptions for a hypothesis test + A simple random sample of size #emph[n] is taken. + The conditions for the binomial distribution are satisfied + To determine the sampling distribution of #math.equation(block: false, alt: "p ^")[$hat(p)$], you need to show that #math.equation(block: false, alt: "n p greater than or equal to 5")[$n p ≥ 5$] and #math.equation(block: false, alt: "n q greater than or equal to 5")[$n q ≥ 5$], where #math.equation(block: false, alt: "q equals 1 minus p")[$q = 1 − p$]. If this requirement is true, then the sampling distribution of #math.equation(block: false, alt: "p ^")[$hat(p)$] is well approximated by a normal curve. + Find the sample statistic, test statistic, and p-value #linebreak() Sample Proportion: #linebreak() #math.equation(block: false, alt: "p ^ equals the fraction x over n equals the fraction # of successes over # of trials")[$hat(p) = frac(x, n) = frac(\# " of successes ", \# " of trials ")$] #linebreak() Test Statistic: #linebreak() #math.equation(block: false, alt: "z equals the fraction p ^ minus p over the square root of n p q")[$z = frac(hat(p) − p, sqrt(limits(n)^(p q)))$] #linebreak() p-value: #linebreak() TI-83/84: Use normalcdf(lower limit, upper limit, 0, 1) R: Use pnorm(z, 0, 1) #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] if #math.equation(block: false, alt: "H sub A : p less than p sub o")[$H_(A) : p < p_(o)$], then lower limit is #math.equation(block: false, alt: "minus 1 E 99")[$− 1 E 99$] and upper limit is your test statistic. If #math.equation(block: false, alt: "H sub A : p greater than p sub o")[$H_(A) : p > p_(o)$], then lower limit is your test statistic and the upper limit is #math.equation(block: false, alt: "1 E 99")[$1 E 99$]. If #math.equation(block: false, alt: "H sub A : p not equal to p sub o")[$H_(A) : p ≠ p_(o)$], then find the p-value for #math.equation(block: false, alt: "H sub A : p less than p sub o")[$H_(A) : p < p_(o)$], and multiply by 2. ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] If #math.equation(block: false, alt: "H sub A : p less than p sub o")[$H_(A) : p < p_(o)$], then you can use pnorm. If #math.equation(block: false, alt: "H sub A : p greater than p sub o")[$H_(A) : p > p_(o)$], then you have to find pnorm and then subtract from 1. If #math.equation(block: false, alt: "H sub A : p not equal to p sub o")[$H_(A) : p ≠ p_(o)$], then find the p-value for #math.equation(block: false, alt: "H sub A : p less than p sub o")[$H_(A) : p < p_(o)$], and multiply by 2. ] + Conclusion #linebreak() This is where you write reject #math.equation(block: false, alt: "H sub o")[$H_(o)$] or fail to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. The rule is: if the p-value \< #math.equation(block: false, alt: "α")[$α$], then reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. If the p-value #math.equation(block: false, alt: "greater than or equal to α")[$≥ α$], then fail to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. + Interpretation #linebreak() This is where you interpret in real world terms the conclusion to the test. The conclusion for a hypothesis test is that you either have enough evidence to show #math.equation(block: false, alt: "H sub A")[$H_(A)$] is true, or you do not have enough evidence to show #math.equation(block: false, alt: "H sub A")[$H_(A)$] is true. #examplebox("Example 1")[hypothesis test for one proportion using formula][ A concern was raised in Australia that the percentage of deaths of Aboriginal prisoners was higher than the percent of deaths of non-Aboriginal prisoners, which is 0.27%. A sample of six years (1990-1995) of data was collected, and it was found that out of 14,495 Aboriginal prisoners, 51 died ("Indigenous deaths in," 1996). Do the data provide enough evidence to show that the proportion of deaths of Aboriginal prisoners is more than 0.27%? + State the random variable and the parameter in words. + State the null and alternative hypotheses and the level of significance. + State and check the assumptions for a hypothesis test. + Find the sample statistic, test statistic, and p-value. + Conclusion + Interpretation #solutionbox[ 1. #emph[x] = number of Aboriginal prisoners who die #emph[p] = proportion of Aboriginal prisoners who die 2. #math.equation(block: false, alt: "H sub o : p equals 0.0027; H sub A : p greater than 0.0027")[$H_(o) : p = 0.0027 \ H_(A) : p > 0.0027$] Example #math.equation(block: false, alt: "5")[$5$]b argued that the #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$]. 3. + A simple random sample of 14,495 Aboriginal prisoners was taken. However, the sample was not a random sample, since it was data from six years. It is the numbers for all prisoners in these six years, but the six years were not picked at random. Unless there was something special about the six years that were chosen, the sample is probably a representative sample. This assumption is probably met. + There are 14,495 prisoners in this case. The prisoners are all Aboriginals, so you are not mixing Aboriginal with non-Aboriginal prisoners. There are only two outcomes, either the prisoner dies or doesn’t. The chance that one prisoner dies over another may not be constant, but if you consider all prisoners the same, then it may be close to the same probability. Thus the conditions for the binomial distribution are satisfied + In this case #emph[p]= 0.0027 and #emph[n] = 14,495. #math.equation(block: false, alt: "n p equals 14495 to the power * 0.0027 approximately equals 39 greater than or equal to 5")[$n p = 14495^(*) 0.0027 ≈ 39 ≥ 5$] and #math.equation(block: false, alt: "n q equals 14495 to the power * open parenthesis 1 minus 0.0027 close parenthesis approximately equals 14456 greater than or equal to 5")[$n q = 14495^(*) ( 1 − 0.0027 ) ≈ 14456 ≥ 5$]. So, the sampling distribution for #math.equation(block: false, alt: "p ^")[$hat(p)$] is a normal distribution. 4. Sample Proportion: #emph[x] = 51 #emph[n]= 14495 #math.equation(block: true, alt: "p ^ equals the fraction x over n equals the fraction 51 over 14495 approximately equals 0.003518")[$hat(p) = frac(x, n) = frac(51, 14495) ≈ 0.003518$] Test Statistic: #math.equation(block: true, alt: "z equals the fraction p ^ minus p over the square root of the fraction p q over n equals the fraction 0.003518 minus 0.0027 over the square root of the fraction 0.0027 open parenthesis 1 minus 0.0027 close parenthesis over 14495 approximately equals 1.8979")[$z = frac(hat(p) − p, sqrt(frac(p q, n))) = frac(0.003518 − 0.0027, sqrt(frac(0.0027 ( 1 − 0.0027 ), 14495))) ≈ 1.8979$] p-value: TI-83/84: p-value = #math.equation(block: false, alt: "P open parenthesis z greater than 1.8979 close parenthesis equals normalcdf open parenthesis 1.8979 , 1 E 99 , 0 , 1 close parenthesis approximately equals 0.029")[$P ( z > 1.8979 ) = " normalcdf " ( 1.8979 , 1 E 99 , 0 , 1 ) ≈ 0.029$] R: p-value = #math.equation(block: false, alt: "P open parenthesis z greater than 1.8979 close parenthesis equals 1 minus pnorm open parenthesis 1.8979 , 0 , 1 close parenthesis approximately equals 0.029")[$P ( z > 1.8979 ) = 1 − " pnorm " ( 1.8979 , 0 , 1 ) ≈ 0.029$] pnorm(1.8979, 0, 1) 5. Since the p-value \< 0.05, then reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. 6. There is enough evidence to show that the proportion of deaths of Aboriginal prisoners is more than for non-Aboriginal prisoners. ] ] #examplebox("Example 2")[hypothesis test for one proportion using technology][ A researcher who is studying the effects of income levels on breastfeeding of infants hypothesizes that countries where the income level is lower have a higher rate of infant breastfeeding than higher income countries. It is known that in Germany, considered a high-income country by the World Bank, 22% of all babies are breastfeed. In Tajikistan, considered a low-income country by the World Bank, researchers found that in a random sample of 500 new mothers that 125 were breastfeeding their infant. At the 5% level of significance, does this show that low-income countries have a higher incident of breastfeeding? #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[The 1-PropZTest, pre-configured] The test opens right-tailed at α = 0.05, matching the calculator setup screen — enter p₀ = 0.22, x = 125, n = 500 and Run Test. - 1-PropZTest: z = 1.619, p-value = 0.0527, p̂ = 0.25 ] + State you random variable and the parameter in words. + State the null and alternative hypotheses and the level of significance. + State and check the assumptions for a hypothesis test. + Find the sample statistic, test statistic, and p-value. + Conclusion + Interpretation #solutionbox[ 1. #emph[x]= number of woman who breastfeed in a low-income country #emph[p]= proportion of woman who breastfeed in a low-income country 2. #math.equation(block: false, alt: "H sub o : p equals 0.22; H sub A : p greater than 0.22; α equals 0.05")[$H_(o) : p = 0.22 \ H_(A) : p > 0.22 \ α = 0.05$] 3. + A simple random sample of 500 breastfeeding habits of woman in a low-income country was taken as was stated in the problem. + There were 500 women in the study. The women are considered identical, though they probably have some differences. There are only two outcomes, either the woman breastfeeds or she doesn’t. The probability of a woman breastfeeding is probably not the same for each woman, but it is probably not very different for each woman. The conditions for the binomial distribution are satisfied + In this case, #emph[n] = 500 and #emph[p]= 0.22. #math.equation(block: false, alt: "n p equals 500 open parenthesis 0.22 close parenthesis equals 110 greater than or equal to 5")[$n p = 500 ( 0.22 ) = 110 ≥ 5$] and #math.equation(block: false, alt: "n q equals 500 open parenthesis 1 minus 0.22 close parenthesis equals 390 greater than or equal to 5")[$n q = 500 ( 1 − 0.22 ) = 390 ≥ 5$], so the sampling distribution of #math.equation(block: false, alt: "p ^")[$hat(p)$] is well approximated by a normal curve. 4. This time, all calculations will be done with technology. On the TI-83/84 calculator. Go into the STAT menu, then arrow over to TESTS. This test is a 1-propZTest. Then type in the information just as shown in #emph[Figure #math.equation(block: false, alt: "1")[$1$]]. #figure(figph[TI-83/84 calculator 1-PropZTest input screen showing p0=.22, x=125, n=500, and the alternative proportion p greater than p0 selected.], alt: "TI-83/84 calculator 1-PropZTest input screen showing p0=.22, x=125, n=500, and the alternative proportion p greater than p0 selected.", caption: [Figure #math.equation(block: false, alt: "1")[$1$]: Setup for 1-Proportion Test]) Once you press Calculate, you will see the results as in #emph[Figure #math.equation(block: false, alt: "2")[$2$]]. #figure(figph[TI-84 calculator screen showing 1-PropZTest results with alternative proportion greater than 0.22, z = 1.619375689, p = 0.052683219, sample proportion 0.25, and n = 500.], alt: "TI-84 calculator screen showing 1-PropZTest results with alternative proportion greater than 0.22, z = 1.619375689, p = 0.052683219, sample proportion 0.25, and n = 500.", caption: [Figure #math.equation(block: false, alt: "2")[$2$]: Results for 1-Proportion Test]) The z in the results is the test statistic. The #emph[p] = 0.052683219 is the p-value, and the #math.equation(block: false, alt: "p ^ equals 0.25")[$hat(p) = 0.25$] is the sample proportion. The p-value is approximately 0.053. On R, the command is prop.test(x, n, po, alternative = "less" or "greater"), where po is what #math.equation(block: false, alt: "H sub o")[$H_(o)$] says p equals, and you use less if your #math.equation(block: false, alt: "H sub A")[$H_(A)$] is less and greater if your #math.equation(block: false, alt: "H sub A")[$H_(A)$] is greater. If your #math.equation(block: false, alt: "H sub A")[$H_(A)$] is not equal to, then leave off the alternative statement. So for this example, the command would be prop.test(125, 500, .22, alternative = "greater") prop.test(125, 500, .22, alternative = "greater") 1-sample proportions test with continuity correction data: 125 out of 500, null probability 0.22 X-squared = 2.4505, df = 1, p-value = 0.05874 alternative hypothesis: true p is greater than 0.22 95 percent confidence interval: 0.218598 1.000000 sample estimates: p 0.25 #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] R does a continuity correction that the formula and the TI-83/84 calculator do not do. You can put in a command that says not to use the continuity correction, but it is correct to use it. Also, R doesn’t give the z test statistic, so you don’t need to worry about this. It does give a p-value that is slightly off from the formula and the calculator due to the continuity correction. ] p-value = 0.05874 5. Since the p-value is more than 0.05, you fail to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. 6. There is not enough evidence to show that the proportion of women who breastfeed in low-income countries is more than in high-income countries. ] ] Notice, the conclusion is that there wasn't enough evidence to show what #math.equation(block: false, alt: "H sub 1")[$H_(1)$] said. The conclusion was not that you proved #math.equation(block: false, alt: "H sub o")[$H_(o)$] true. There are many reasons why you can’t say that #math.equation(block: false, alt: "H sub o")[$H_(o)$] is true. It could be that the countries you chose were not very representative of what truly happens. If you instead looked at all high-income countries and compared them to low-income countries, you might have different results. It could also be that the sample you collected in the low-income country was not representative. It could also be that income level is not an indication of breastfeeding habits. There could be other factors involved. This is why you can’t say that you have proven #math.equation(block: false, alt: "H sub o")[$H_(o)$] is true. There are too many other factors that could be the reason that you failed to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. === Homework #notebox("Your Turn", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ In each problem show all steps of the hypothesis test. If some of the assumptions are not met, note that the results of the test may not be correct and then continue the process of the hypothesis test. + Eyeglassomatic manufactures eyeglasses for different retailers. They test to see how many defective lenses they made in a given time period and found that 11% of all lenses had defects of some type. Looking at the type of defects, they found in a three-month time period that out of 34,641 defective lenses, 5865 were due to scratches. Are there more defects from scratches than from all other causes? Use a 1% level of significance. + In July of 1997, Australians were asked if they thought unemployment would increase, and 47% thought that it would increase. In November of 1997, they were asked again. At that time 284 out of 631 said that they thought unemployment would increase ("Morgan gallup poll," 2013). At the 5% level, is there enough evidence to show that the proportion of Australians in November 1997 who believe unemployment would increase is less than the proportion who felt it would increase in July 1997? + According to the February 2008 Federal Trade Commission report on consumer fraud and identity theft, 23% of all complaints in 2007 were for identity theft. In that year, Arkansas had 1,601 complaints of identity theft out of 3,482 consumer complaints ("Consumer fraud and," 2008). Does this data provide enough evidence to show that Arkansas had a higher proportion of identity theft than 23%? Test at the 5% level. + According to the February 2008 Federal Trade Commission report on consumer fraud and identity theft, 23% of all complaints in 2007 were for identity theft. In that year, Alaska had 321 complaints of identity theft out of 1,432 consumer complaints ("Consumer fraud and," 2008). Does this data provide enough evidence to show that Alaska had a lower proportion of identity theft than 23%? Test at the 5% level. + In 2001, the Gallup poll found that 81% of American adults believed that there was a conspiracy in the death of President Kennedy. In 2013, the Gallup poll asked 1,039 American adults if they believe there was a conspiracy in the assassination, and found that 634 believe there was a conspiracy ("Gallup news service," 2013). Do the data show that the proportion of Americans who believe in this conspiracy has decreased? Test at the 1% level. + In 2008, there were 507 children in Arizona out of 32,601 who were diagnosed with Autism Spectrum Disorder (ASD) ("Autism and developmental," 2008). Nationally 1 in 88 children are diagnosed with ASD ("CDC features -," 2013). Is there sufficient data to show that the incident of ASD is more in Arizona than nationally? Test at the 1% level. Answer For all hypothesis tests, just the conclusion is given. See solutions for the entire answer. 1. Reject Ho. 3. Reject Ho. 5. Reject Ho. ]