#set document(title: "7.2 Confidence Interval for a 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")) == 7.2#h(0.6em)Confidence Interval for a Proportion Suppose you want to estimate the population proportion,#emph[p]. As an example, an administrator may want to know what proportion of students at your school smoke. An insurance company may want to know what proportion of accidents are caused by teenage drivers who do not have a drivers’ education class. Every time we collect data from a new sample, we would expect the estimate of the proportion to change slightly. If you were to find a range of values over an interval this would give a better estimate of where the population proportion falls. This range of values that would better predict the true population parameter is called an interval estimate or confidence interval. The sample proportion #math.equation(block: false, alt: "p hat")[$hat(p)$] is the point estimate for p, the standard error (the standard deviation of the sampling distribution) of #math.equation(block: false, alt: "p hat")[$hat(p)$] is #math.equation(block: false, alt: "the square root of open parenthesis the fraction p hat times q hat over n close parenthesis")[$sqrt(( frac(hat(p) · hat(q), n) ))$], the z#sub[α]#sub[/2]is the critical value using the standard normal distribution, and the margin of error #math.equation(block: false, alt: "E equals Z sub α / 2 the square root of open parenthesis the fraction p hat times q hat over n close parenthesis")[$E = Z_(α / 2) sqrt(( frac(hat(p) · hat(q), n) ))$]. Some textbooks use #math.equation(block: false, alt: "π")[$π$] instead of #emph[p] for the population proportion, and #math.equation(block: false, alt: "p bar")[$overline(p)$] (pronounced “p-bar”) instead of #math.equation(block: false, alt: "p hat")[$hat(p)$] for sample proportion. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ Choose a simple random sample of size #emph[n] from a population having unknown population proportion #emph[p]. The 100(1 – #math.equation(block: false, alt: "α")[$α$])% confidence interval estimate for #emph[p] is given by #math.equation(block: false, alt: "p hat ± Z sub α / 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis")[$hat(p) ± Z_(α / 2) sqrt(( frac(hat(p) hat(q), n) ))$]. Where #math.equation(block: false, alt: "p hat equals the fraction x over n equals the fraction # of successes over # of trials")[$hat(p) = frac(x, n) = frac(\# " of successes ", \# " of trials ")$] (read as “p hat”) is the sample proportion, and #math.equation(block: false, alt: "q hat equals 1 minus p hat")[$hat(q) = 1 − hat(p)$] is the complement. ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The above confidence interval can be expressed as an inequality or an interval of values. #math.equation(block: true, alt: "p hat minus z sub α / 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis less than p less than p hat plus z sub α / 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis or open parenthesis p hat minus z sub the fraction α over 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis , p hat plus z sub α / 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis close parenthesis")[$hat(p) − z_(α / 2) sqrt(( frac(hat(p) hat(q), n) )) < p < hat(p) + z_(α / 2) sqrt(( frac(hat(p) hat(q), n) )) #h(1em) " or " #h(1em) ( hat(p) − z_(frac(α, 2)) sqrt(( frac(hat(p) hat(q), n) )) , hat(p) + z_(α / 2) sqrt(( frac(hat(p) hat(q), n) )) )$] Assumption: #math.equation(block: false, alt: "n times p hat greater than or equal to 10 and n times q hat greater than or equal to 10")[$n · hat(p) ≥ 10 " and " n · hat(q) ≥ 10$] \*This assumption #strong[must be] addressed before using these statistical inferences. ] This formula is derived from the normal approximation of the binomial distribution, therefore the same conditions for a binomial need to be met, namely a set sample size of independent trials, two outcomes that have the same probability for each trial. #strong[Steps for Calculating a Confidence Interval] 1. State the random variable and the parameter in words. x = number of successes p = proportion of successes 2. State and check the assumptions for confidence interval. a. A simple random sample of size n is taken. b. The conditions for the binomial distribution are satisfied. c. To determine the sampling distribution of #math.equation(block: false, alt: "p hat")[$hat(p)$], you need to show that #math.equation(block: false, alt: "n times p hat greater than or equal to 10 and n times q hat greater than or equal to 10")[$n · hat(p) ≥ 10 " and " n · hat(q) ≥ 10$], where #math.equation(block: false, alt: "q hat")[$hat(q)$] = 1 − #math.equation(block: false, alt: "p hat")[$hat(p)$]. If this requirement is true, then the sampling distribution of #math.equation(block: false, alt: "p hat")[$hat(p)$] is well approximated by a normal curve. (In reality, this is not really true, since the correct assumption deals with p. However, in a confidence interval you do not know p, so you must use #math.equation(block: false, alt: "p hat")[$hat(p)$]. This means you just need to show that x ≥ 10 and n – x ≥ 10.) 3. Compute the sample statistic #math.equation(block: false, alt: "p hat equals the fraction x over n")[$hat(p) = frac(x, n)$] and the confidence interval #math.equation(block: false, alt: "p hat ± z sub the fraction α over 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis")[$hat(p) ± z_(frac(α, 2)) sqrt(( frac(hat(p) hat(q), n) ))$]. 4. Statistical Interpretation: In general, this looks like: “We can be (1 – α)\*100% confident that the interval #math.equation(block: true, alt: "p hat minus z sub the fraction α over 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis less than p less than p hat plus z sub the fraction α over 2 the square root of open parenthesis the fraction p hat q hat over n close parenthesis")[$hat(p) − z_(frac(α, 2)) sqrt(( frac(hat(p) hat(q), n) )) < p < hat(p) + z_(frac(α, 2)) sqrt(( frac(hat(p) hat(q), n) ))$] Real World Interpretation: This is where you state what interval contains the true proportion. #examplebox("Example 1")[][ A concern was raised in Australia that the percentage of deaths of indigenous Australian prisoners was higher than the percent of deaths of nonindigenous Australian 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 indigenous Australian prisoners, 51 died (“Indigenous deaths in,” 1996). Find a 95% confidence interval for the proportion of indigenous Australian prisoners who died. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Start the interval at its critical value] Opens the inverse-normal mode pre-loaded with area 0.975 -- the z needed for 95% confidence. From there the interval is arithmetic: 0.003518 +/- 0.000964 gives (0.002554, 0.004482); enter area 0.95 instead to get the critical value for the 90% breastfeeding example. - z for 95%: invNorm(0.975) = 1.96 ] #solutionbox[ 1. State the random variable and the parameter in words. x = number of indigenous Australian prisoners who die p = proportion of indigenous Australian prisoners who die 2. State and check the assumptions for a confidence interval. a. A simple random sample of 14,495 indigenous Australian 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. b. There are 14,495 prisoners in this case. The prisoners are all indigenous Australians, so you are not mixing indigenous Australian with nonindigenous Australian prisoners. There are only two outcomes, the prisoner either dies or does not. 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 assumptions for the binomial distribution are satisfied. c. In this case, x = 51 and n – x = 14,495 – 51 = 14,444. Both are greater than or equal to 10. The sampling distribution for #math.equation(block: false, alt: "p hat")[$hat(p)$] is a normal distribution. 3. Compute the sample statistic and the confidence interval. Sample Proportion: #math.equation(block: false, alt: "p hat equals the fraction x over n equals the fraction 51 over 14495 equals .003518")[$hat(p) = frac(x, n) = frac(51, 14495) = ".003518"$], Critical Value: #math.equation(block: false, alt: "z sub α / 2 equals 1.96")[$z_(α / 2) = 1.96$], since 95% confidence level Margin of Error #math.equation(block: false, alt: "E equals z sub α / 2 the square root of open parenthesis the fraction p hat times q hat over n close parenthesis equals 1.96 the square root of open parenthesis the fraction 0.003518 open parenthesis 1 minus 0.003518 close parenthesis over 14495 close parenthesis equals 0.000964")[$E = z_(α / 2) sqrt(( frac(hat(p) · hat(q), n) )) = 1.96 sqrt(( frac(0.003518 ( 1 − 0.003518 ), 14495) )) = 0.000964$] Confidence Interval: #math.equation(block: false, alt: "p hat minus E less than p less than p hat plus E")[$hat(p) − E < p < hat(p) + E$] 0.003518 – 0.000964 \< p \< 0.003518 + 0.000964 0.002554 \< p \< 0.004482 or (0.002554, 0.004482) 4. Statistical Interpretation: We can be 95% confident that 0.002554 \< p \< 0.004482 contains the proportion of all indigenous Australian prisoners who died. 5. Real World Interpretation: We can be 95% confident that the percentage of all indigenous Australian prisoners who died is between 0.26% and 0.45%. ] ] #strong[Using Technology] Excel has no built-in shortcut key for finding a confidence interval for a proportion, but if you type in the following formulas shown below you can make your own Excel calculator where you just change the highlighted cells and all the numbers below will update with the relevant information. Type in the following be cognizant of cell reference numbers. #figure(figph[Excel worksheet titled Confidence Interval for a Proportion with inputs x 51, n 14495, and C-Level 0.95, and formulas z =-NORM.S.INV((1-B4)/2), p-bar =B2/B3, q-bar =1-B6, E =B5\*SQRT(B6\*B7/B3), lower boundary =B6-B8, and upper boundary =B6+B8.], alt: "Excel worksheet titled Confidence Interval for a Proportion with inputs x 51, n 14495, and C-Level 0.95, and formulas z =-NORM.S.INV((1-B4)/2), p-bar =B2/B3, q-bar =1-B6, E =B5*SQRT(B6*B7/B3), lower boundary =B6-B8, and upper boundary =B6+B8.", caption: none) You get the following answers where the last two numbers are your confidence interval limits. #figure(figph[Excel worksheet titled Confidence Interval for a Proportion showing the computed values x 51, n 14495, C-Level 0.95, z 1.9600, p-bar 0.003518, q-bar 0.996482, E 0.000964, lower boundary 0.002555, and upper boundary 0.004482.], alt: "Excel worksheet titled Confidence Interval for a Proportion showing the computed values x 51, n 14495, C-Level 0.95, z 1.9600, p-bar 0.003518, q-bar 0.996482, E 0.000964, lower boundary 0.002555, and upper boundary 0.004482.", caption: none) Make sure to put your answer in interval notation (0.002555, 0.004482) or 0.26% \< p \< 0.45%. You can also do the calculations for the confidence interval with the TI Calculator. #strong[TI-84:] Press the \[STAT\] key, arrow over to the \[TESTS\] menu, arrow down to the \[A:1-PropZInterval\] option and press the \[ENTER\] key. Then type in the values for x, sample size and confidence level, arrow down to \[Calculate\] and press the \[ENTER\] key. The calculator returns the answer in interval notation. 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 n = 124 then 0.22\*124 = 27.28, so use x = 27. #figure(figph[Three TI-84 screens: the STAT TESTS menu with A:1-PropZInt selected, the 1-PropZInt input screen with x:51, n:14495, C-Level:.95 and Calculate highlighted, and the output interval (.00255,.00448) with p-hat=.0035184546 and n=14495.], alt: "Three TI-84 screens: the STAT TESTS menu with A:1-PropZInt selected, the 1-PropZInt input screen with x:51, n:14495, C-Level:.95 and Calculate highlighted, and the output interval (.00255,.00448) with p-hat=.0035184546 and n=14495.", caption: none) #strong[TI-89:] Go to the \[Apps\] #strong[Stat/List Editor], then press \[2#super[nd]\] then F7 \[Ints\], then select#strong[5: 1-PropZInt]. Type in the values for x, sample size and confidence level, and press the \[ENTER\] key. The calculator returns the answer in interval notation. 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. #examplebox("Example 2")[][ A researcher studying the effects of income levels on new mothers breastfeeding their infants hypothesizes that those countries where the income level is lower has a higher rate of infants 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 breastfed. 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 infants. Find a 90% confidence interval of the proportion of mothers in low-income countries who breastfeed their infants. #solutionbox[ 1. State your random variable and the parameter in words. x = The number of new mothers who breastfeed in a low-income country. p = The proportion of new mothers who breastfeed in a low-income country. 2. State and check the assumptions for a confidence interval. a. A simple random sample of 500 breastfeeding habits of new mothers in a low-income country was taken as was stated in the problem. b. 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 her baby or she does not. The probability of a woman breastfeeding her baby is probably not the same for each woman, but it is probably not that different for each woman. The assumptions for the binomial distribution are satisfied. c. x = 125 and n – x = 500 – 125 = 375 and both are greater than or equal to 10, so the sampling distribution of #math.equation(block: false, alt: "p hat")[$hat(p)$] is well approximated by a normal curve. 3. Compute the sample statistic and the confidence interval. On the TI-83/84: Go into the STAT menu. Move over to TESTS and choose 1- PropZInt, then press Calculate. #figure(figph[TI-84 1-PropZInt input and output screens: inputs x:125, n:500, C-Level:.9 with Calculate selected, and the resulting interval (.21815,.28185) with p-hat=.25 and n=500.], alt: "TI-84 1-PropZInt input and output screens: inputs x:125, n:500, C-Level:.9 with Calculate selected, and the resulting interval (.21815,.28185) with p-hat=.25 and n=500.", caption: none) 4. Statistical Interpretation: We are 90% confident that the interval 0.219 \< p \< 0.282 contains the population proportion of all women in low-income countries who breastfeed their infants. 5. Real World Interpretation: The proportion of women in low-income countries who breastfeed their infants is between 0.219 and 0.282 with 90% confidence. ] ] #examplebox("Example 3")[][ ]