WorldClass Statistics · Appendix: Exercise solutions

Solutions: Inference for categorical data

9.213(a) False. Doesn’t satisfy success-failure condition. (b) True. The success-failure condition is not satisfied. In most samples we would expect p^\hat{p} to be close to 0.08, the true population proportion. While p^\hat{p} can be much above 0.08, it is bound below by 0, suggesting it would take on a right skewed shape. Plotting the sampling distribution would confirm this suspicion. (c) False. SEp^=0.0243SE_{\hat{p}} = 0.0243, and p^=0.12\hat{p} = 0.12 is only 0.12−0.080.0243=1.65\frac{0.12 - 0.08}{0.0243} = 1.65 SEs away from the mean, which would not be considered unusual. (d) True. p^=0.12\hat{p}=0.12 is 2.32 standard errors away from the mean, which is often considered unusual. (e) False. Decreases the SE by a factor of 1/21/\sqrt{2}.

9.215(a) True. See the reasoning of 6.1(b). (b) True. We take the square root of the sample size in the SE formula. (c) True. The independence and success-failure conditions are satisfied. (d) True. The independence and success-failure conditions are satisfied.

9.217(a) False. A confidence interval is constructed to estimate the population proportion, not the sample proportion. (b) True. 95% CI: 82% ± 2%82\%\ \pm\ 2\%. (c) True. By the definition of the confidence level. (d) True. Quadrupling the sample size decreases the SE and ME by a factor of 1/41/\sqrt{4}. (e) True. The 95% CI is entirely above 50%.

9.219With a random sample, independence is satisfied. The success-failure condition is also satisfied. ME=z⋆p^(1−p^)n=1.960.56×0.44600=0.0397≈4%ME = z^{\star} \sqrt{ \frac{\hat{p} (1-\hat{p})} {n} } = 1.96 \sqrt{ \frac{0.56 \times 0.44}{600} }= 0.0397 \approx 4\%

9.221(a) No. The sample only represents students who took the SAT, and this was also an online survey. (b) (0.5289, 0.5711). We are 90% confident that 53% to 57% of high school seniors who took the SAT are fairly certain that they will participate in a study abroad program in college. (c) 90% of such random samples would produce a 90% confidence interval that includes the true proportion. (d) Yes. The interval lies entirely above 50%.

9.223(a) We want to check for a majority (or minority), so we use the following hypotheses: H0:p=0.5HA:p≠0.5\begin{aligned} &H_0: p = 0.5 &&H_A: p \neq 0.5 \end{aligned} We have a sample proportion of p^=0.55\hat{p} = 0.55 and a sample size of n=617n = 617 independents.
Since this is a random sample, independence is satisfied. The success-failure condition is also satisfied: 617×0.5617 \times 0.5 and 617×(1−0.5)617 \times (1 - 0.5) are both at least 10 (we use the null proportion p0=0.5p_0 = 0.5 for this check in a one-proportion hypothesis test).
Therefore, we can model p^\hat{p} using a normal distribution with a standard error of SE=p(1−p)n=0.02\begin{aligned} SE = \sqrt{\frac{p(1 - p)}{n}} = 0.02 \end{aligned} (We use the null proportion p0=0.5p_0 = 0.5 to compute the standard error for a one-proportion hypothesis test.) Next, we compute the test statistic: Z=0.55−0.50.02=2.5\begin{aligned} Z = \frac{0.55 - 0.5}{0.02} = 2.5 \end{aligned} This yields a one-tail area of 0.0062, and a p-value of 2×0.0062=0.01242 \times 0.0062 = 0.0124.
Because the p-value is smaller than 0.05, we reject the null hypothesis. We have strong evidence that the support is different from 0.5, and since the data provide a point estimate above 0.5, we have strong evidence to support this claim by the TV pundit.
(b) No. Generally we expect a hypothesis test and a confidence interval to align, so we would expect the confidence interval to show a range of plausible values entirely above 0.5. However, if the confidence level is misaligned (e.g. a 99% confidence level and a α=0.05\alpha = 0.05 significance level), then this is no longer generally true.

9.225(a) H0:p=0.5H_0: p = 0.5. HA:p≠0.5H_A: p \neq 0.5. Independence (random sample) is satisfied, as is the success-failure conditions (using p0=0.5p_0 = 0.5, we expect 40 successes and 40 failures). Z=2.91Z = 2.91 →\to the one tail area is 0.0018, so the p-value is 0.0036. Since the p-value <0.05< 0.05, we reject the null hypothesis. Since we rejected H0H_0 and the point estimate suggests people are better than random guessing, we can conclude the rate of correctly identifying a soda for these people is significantly better than just by random guessing. (b) If in fact people cannot tell the difference between diet and regular soda and they were randomly guessing, the probability of getting a random sample of 80 people where 53 or more identify a soda correctly (or 53 or more identify a soda incorrectly) would be 0.0036.

9.227Because a sample proportion (p^=0.55\hat{p} = 0.55) is available, we use this for the sample size calculations. The margin of error for a 90% confidence interval is 1.6449×SE=1.6449×p(1−p)n1.6449 \times SE = 1.6449 \times \sqrt{\frac{p(1 - p)}{n}}. We want this to be less than 0.01, where we use p^\hat{p} in place of pp: 1.6449×0.55(1−0.55)n≤0.011.644920.55(1−0.55)0.012≤n\begin{aligned} 1.6449 \times \sqrt{\frac{0.55(1 - 0.55)}{n}} \leq 0.01 \\ 1.6449^2 \frac{0.55(1 - 0.55)}{0.01^2} \leq n \end{aligned} From this, we get that nn must be at least 6697.

9.229This is not a randomized experiment, and it is unclear whether people would be affected by the behavior of their peers. That is, independence may not hold. Additionally, there are only 5 interventions under the provocative scenario, so the success-failure condition does not hold. Even if we consider a hypothesis test where we pool the proportions, the success-failure condition will not be satisfied. Since one condition is questionable and the other is not satisfied, the difference in sample proportions will not follow a nearly normal distribution.

9.231(a) False. The entire confidence interval is above 0. (b) True. (c) True. (d) True. (e) False. It is simply the negated and reordered values: (-0.06,-0.02).

9.233(a) Standard error: SE=0.79(1−0.79)347+0.55(1−0.55)617=0.03\begin{aligned} SE = \sqrt{\frac{0.79(1 - 0.79)}{347} + \frac{0.55(1 - 0.55)}{617}} = 0.03 \end{aligned} Using z⋆=1.96z^{\star} = 1.96, we get: 0.79−0.55±1.96×0.03→(0.181,0.299)\begin{aligned} 0.79 - 0.55 \pm 1.96 \times 0.03 \to (0.181, 0.299) \end{aligned} We are 95% confident that the proportion of Democrats who support the plan is 18.1% to 29.9% higher than the proportion of Independents who support the plan. (b) True.

9.235(a) College grads: 23.7%. Non-college grads: 33.7%. (b) Let pCGp_{CG} and pNCGp_{NCG} represent the proportion of college graduates and non-college graduates who responded “do not know". H0:pCG=pNCGH_0: p_{CG} = p_{NCG}. HA:pCG≠pNCGH_A: p_{CG} \ne p_{NCG}. Independence is satisfied (random sample), and the success-failure condition, which we would check using the pooled proportion (p^pool=235/827=0.284\hat{p}_{\textit{pool}} = 235/827 = 0.284), is also satisfied. Z=−3.18Z = -3.18 →\to p-value = 0.0014. Since the p-value is very small, we reject H0H_0. The data provide strong evidence that the proportion of college graduates who do not have an opinion on this issue is different than that of non-college graduates. The data also indicate that fewer college grads say they “do not know” than non-college grads (i.e. the data indicate the direction after we reject H0H_0).

9.237(a) College grads: 35.2%. Non-college grads: 33.9%. (b) Let pCGp_{CG} and pNCGp_{NCG} represent the proportion of college graduates and non-college grads who support offshore drilling. H0:pCG=pNCGH_0: p_{CG} = p_{NCG}. HA:pCG≠pNCGH_A: p_{CG} \ne p_{NCG}. Independence is satisfied (random sample), and the success-failure condition, which we would check using the pooled proportion (p^pool=286/827=0.346\hat{p}_{\textit{pool}} = 286/827 = 0.346), is also satisfied. Z=0.39Z = 0.39 →\to p-value =0.6966=0.6966. Since the p-value >α> \alpha (0.05), we fail to reject H0H_0. The data do not provide strong evidence of a difference between the proportions of college graduates and non-college graduates who support off-shore drilling in California.

9.239Subscript C_C means control group. Subscript T_T means truck drivers. H0:pC=pTH_0: p_C = p_T. HA:pC≠pTH_A: p _C \ne p_T. Independence is satisfied (random samples), as is the success-failure condition, which we would check using the pooled proportion (p^pool=70/495=0.141\hat{p}_{\textit{pool}} = 70/495 = 0.141). Z=−1.65Z = -1.65 →\to p-value =0.0989= 0.0989. Since the p-value is high (default to alpha = 0.05), we fail to reject H0H_0. The data do not provide strong evidence that the rates of sleep deprivation are different for non-transportation workers and truck drivers.

9.241(a) Summary of the study:

Virol. failure
Yes No Total
Treatment Nevaripine 26 94 120
Lopinavir 10 110 120
Total 36 204 240

(b) H0:pN=pLH_0: p_N = p_L. There is no difference in virologic failure rates between the Nevaripine and Lopinavir groups. HA:pN≠pLH_A: p_N \ne p_L. There is some difference in virologic failure rates between the Nevaripine and Lopinavir groups. (c) Random assignment was used, so the observations in each group are independent. If the patients in the study are representative of those in the general population (something impossible to check with the given information), then we can also confidently generalize the findings to the population. The success-failure condition, which we would check using the pooled proportion (p^pool=36/240=0.15\hat{p}_{pool} = 36/240 = 0.15), is satisfied. Z=2.89Z = 2.89 →\to p-value =0.0039=0.0039. Since the p-value is low, we reject H0H_0. There is strong evidence of a difference in virologic failure rates between the Nevaripine and Lopinavir groups. Treatment and virologic failure do not appear to be independent.

9.243(a) False. The chi-square distribution has one parameter called degrees of freedom. (b) True. (c) True. (d) False. As the degrees of freedom increases, the shape of the chi-square distribution becomes more symmetric.

9.245(a) H0H_0: The distribution of the format of the book used by the students follows the professor’s predictions. HAH_A: The distribution of the format of the book used by the students does not follow the professor’s predictions. (b) Ehard copy=126×0.60=75.6E_{hard~copy} = 126 \times 0.60 = 75.6. Eprint=126×0.25=31.5E_{print} = 126 \times 0.25 = 31.5. Eonline=126×0.15=18.9E_{online} = 126 \times 0.15 = 18.9. (c) Independence: The sample is not random. However, if the professor has reason to believe that the proportions are stable from one term to the next and students are not affecting each other’s study habits, independence is probably reasonable. Sample size: All expected counts are at least 5. (d) χ2=2.32\chi^2 = 2.32, df=2df=2, p-value = 0.313. (e) Since the p-value is large, we fail to reject H0H_0. The data do not provide strong evidence indicating the professor’s predictions were statistically inaccurate.

9.247(a) Two-way table:

Quit
Treatment Yes No Total
Patch + support group 40 110 150
Only patch 30 120 150
Total 70 230 300

(b-i) Erow1,col1=(row 1 total)×(col 1 total)table total=35E_{row_1, col_1} = \frac{(row~1~total)\times(col~1~total)}{table~total} = 35. This is lower than the observed value.
(b-ii) Erow2,col2=(row 2 total)×(col 2 total)table total=115E_{row_2, col_2} = \frac{(row~2~total)\times(col~2~total)}{table~total} = 115. This is lower than the observed value.

9.249H0H_0: The opinion of college grads and non-grads is not different on the topic of drilling for oil and natural gas off the coast of California. HAH_A: Opinions regarding the drilling for oil and natural gas off the coast of California has an association with earning a college degree. Erow 1,col 1=151.5Erow 1,col 2=134.5Erow 2,col 1=162.1Erow 2,col 2=143.9Erow 3,col 1=124.5Erow 3,col 2=110.5\begin{aligned} &E_{row~1, col~1} = 151.5 && E_{row~1, col~2} = 134.5 \\ &E_{row~2, col~1} = 162.1 && E_{row~2, col~2} = 143.9 \\ &E_{row~3, col~1} = 124.5 && E_{row~3, col~2} = 110.5 \end{aligned} Independence: The samples are both random, unrelated, and from less than 10% of the population, so independence between observations is reasonable. Sample size: All expected counts are at least 5. χ2=11.47\chi^2 = 11.47, df=2df = 2 →\to p-value = 0.003. Since the p-value <α< \alpha, we reject H0H_0. There is strong evidence that there is an association between support for off-shore drilling and having a college degree.

9.251No. The samples at the beginning and at the end of the semester are not independent since the survey is conducted on the same students.

9.253(a) H0H_0: The age of Los Angeles residents is independent of shipping carrier preference variable. HAH_A: The age of Los Angeles residents is associated with the shipping carrier preference variable. (b) The conditions are not satisfied since some expected counts are below 5.

9.255(a) Independence is satisfied (random sample), as is the success-failure condition (40 smokers, 160 non-smokers). The 95% CI: (0.145, 0.255). We are 95% confident that 14.5% to 25.5% of all students at this university smoke. (b) We want z⋆SEz^{\star}SE to be no larger than 0.02 for a 95% confidence level. We use z⋆=1.96z^{\star}=1.96 and plug in the point estimate p^=0.2\hat{p}=0.2 within the SE formula: 1.960.2(1−0.2)/n≤0.021.96\sqrt{0.2(1-0.2)/n} \leq 0.02. The sample size nn should be at least 1,537.

9.257(a) Proportion of graduates from this university who found a job within one year of graduating. p^=348/400=0.87\hat{p} = 348/400 = 0.87. (b) This is a random sample, so the observations are independent. Success-failure condition is satisfied: 348 successes, 52 failures, both well above 10. (c) (0.8371, 0.9029). We are 95% confident that approximately 84% to 90% of graduates from this university found a job within one year of completing their undergraduate degree. (d) 95% of such random samples would produce a 95% confidence interval that includes the true proportion of students at this university who found a job within one year of graduating from college. (e) (0.8267, 0.9133). Similar interpretation as before. (f) 99% CI is wider, as we are more confident that the true proportion is within the interval and so need to cover a wider range.

9.259Use a chi-squared goodness of fit test. H0H_0: Each option is equally likely. HAH_A: Some options are preferred over others. Total sample size: 99. Expected counts: (1/3) * 99 = 33 for each option. These are all above 5, so conditions are satisfied. df=3−1=2df = 3 - 1 = 2 and χ2=(43−33)233+(21−33)233+(35−33)233=7.52→\chi^2 = \frac{(43 - 33)^2}{33} + \frac{(21 - 33)^2}{33} + \frac{(35 - 33)^2}{33} = 7.52 \rightarrow p-value =0.023= 0.023. Since the p-value is less than 5%, we reject H0H_0. The data provide convincing evidence that some options are preferred over others.

9.261(a) H0:p=0.38H_0: p = 0.38. HA:p≠0.38H_A: p \ne 0.38. Independence (random sample) and the success-failure condition are satisfied. Z=−20.5Z=-20.5 →\to p-value ≈0\approx 0. Since the p-value is very small, we reject H0H_0. The data provide strong evidence that the proportion of Americans who only use their cell phones to access the internet is different than the Chinese proportion of 38%, and the data indicate that the proportion is lower in the US. (b) If in fact 38% of Americans used their cell phones as a primary access point to the internet, the probability of obtaining a random sample of 2,254 Americans where 17% or less or 59% or more use their only their cell phones to access the internet would be approximately 0. (c) (0.1545, 0.1855). We are 95% confident that approximately 15.5% to 18.6% of all Americans primarily use their cell phones to browse the internet.

Credit and licence

“A.6 Solutions: Inference for categorical data” is from OpenIntro Statistics, Fourth Edition, by David M Diez, Mine Çetinkaya-Rundel and Christopher D Barr, shared under a CC BY-SA 3.0 license. WorldClass Statistics is a derivative of OpenIntro Statistics, shared under the same license; the original book may be found at openintro.org/book/os.

Source: https://www.openintro.org/book/os/

Licence: CC BY-SA 3.0 (creativecommons.org/licenses/by-sa/3.0/). You may share and adapt it under the same licence, with this credit. WorldClass adapted the formatting only: the text is the authors', with interactive parts and links to other sites left out.

Build status · Flash Infinity AI™ is a trademark of AI-Flash Inc.. WorldClass is not affiliated with, approved or accredited by any exam board, curriculum provider or university unless a page says so.