### Chapter 7. Hypothesis Testing: Hypothesis Test for a Population Proportion

### Hypothesis Test for a Proportion and Confidence Intervals

Recall that there exists a direct connection between a *two-sided* hypothesis test for #\mu# and a #(1-\alpha)\cdot 100\%# confidence interval for #\mu#.

This same connection does not apply precisely when we are testing hypotheses about a population proportion #\pi#:

- When performing the hypothesis test, we use #\pi_0# to compute the test statistic.
- When constructing a confidence interval, we use #\hat{p}# to compute the margin of error.

However, if you compute the #(1-\alpha)\cdot 100\%# confidence interval for #\pi# using #\pi_0# instead of #\hat{p}# to calculate the margin of error, the connection is reestablished.

#\phantom{0}#

Connecting Hypothesis Testing and Confidence Intervals

If you compute a #(1 - \alpha)\cdot 100\%\,CI# for #\pi# using

\[CI_{\pi}=\bigg(\hat{p}- z^*\cdot \sqrt{\cfrac{\pi_0\cdot(1-\pi_0)}{n}},\,\,\,\, \hat{p} + z^*\cdot \sqrt{\cfrac{\pi_0\cdot(1-\pi_0)}{n}} \bigg)\]

Then:

- If #\pi_0# falls
*inside*the #(1 - \alpha)\cdot 100\%\,CI#, then #H_0: \pi=\pi_0# should not be rejected at the #\alpha# level of significance. - If #\pi_0# falls
*outside*of the #(1 - \alpha)\cdot 100\%\,CI#, then #H_0: \pi=\pi_0# should be rejected at the #\alpha# level of significance.

In a random sample of #112# residents of the land of Oz, #77# of them were in favor of deposing the Wizard.

Construct a #90\%# confidence interval for the proportion #\pi# of the population of Oz that favors deposing the Wizard, using #\pi_0 = 0.60# in the computation of the margin of error. Round your answers to #3# decimal places.

#CI_{\pi,\,90\%}=(0.611,\,\,\, 0.764)#

Based on this confidence interval, the null hypothesis #H_0: \pi = 0.60# *should* be rejected at the #\alpha = 0.10# level of significance because #\pi_0 = 0.60# falls *outside *of the confidence interval.

There are a number of different ways we can compute the *confidence interval*. Click on one of the panels to toggle a specific solution.

Calculate the *sample proportion *#\hat{p}#:

\[\hat{p}=\cfrac{X}{n}=\cfrac{77}{112}=0.6875\]

When using #\pi_0# to calculate the margin of error, the general formula for a #C\%\,CI# for the population proportion #\pi# is:

\[CI_{\pi}=\bigg(\hat{p}- z^*\cdot \sqrt{\cfrac{\pi_0\cdot(1-\pi_0)}{n}},\,\,\,\, \hat{p} + z^*\cdot \sqrt{\cfrac{\pi_0\cdot(1-\pi_0)}{n}} \bigg)\]

For a given *confidence level *#C# (in #\%#), the *critical value* #z^*# of the standard normal distribution is the value such that #\mathbb{P}(-z^* \leq Z \leq z^*)=\cfrac{C}{100}#.

To calculate this critical value #z^*# in Excel, make use of the following function:

NORM.INV(probability, mean, standard_dev)

probability: A probability corresponding to the normal distribution.mean: The mean of the distribution.standard_dev: The standard deviation of the distribution.

Here, we have #C=90#. Thus, to calculate #z^*# such that #\mathbb{P}(-z^* \leq Z \leq z^*)=0.90#, run the following command:

\[\begin{array}{c}

=\text{NORM.INV}((100+C)/200, 0, 1)\\

\downarrow\\

=\text{NORM.INV}(190/200, 0, 1)

\end{array}\]

This gives:

\[z^* = 1.6449\]

Calculate the lower bound #L# of the confidence interval:

\[L = \hat{p} - z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.6875 - 1.6449 \cdot \sqrt{\cfrac{0.60 \cdot (1-0.60)}{112}} = 0.611\]

Calculate the lower bound #U# of the confidence interval:

\[U = \hat{p} + z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.6875 + 1.6449 \cdot \sqrt{\cfrac{0.60 \cdot (1-0.60)}{112}} = 0.764\]

Thus, the #90\%# confidence interval for the population proportion #\pi# is:

\[CI_{\pi,\,90\%}=(0.611,\,\,\, 0.764)\]

Based on this confidence interval, the null hypothesis #H_0: \pi = 0.60# *should* be rejected at the #\alpha = 0.10# level of significance because #\pi_0 = 0.60# falls *outside *of the confidence interval.

Calculate the *sample proportion *#\hat{p}#:

\[\hat{p}=\cfrac{X}{n}=\cfrac{77}{112}=0.6875\]

When using #\pi_0# to calculate the margin of error, the general formula for a #C\%\,CI# for the population proportion #\pi# is:

\[CI_{\pi}=\bigg(\hat{p}- z^*\cdot \sqrt{\cfrac{\pi_0\cdot(1-\pi_0)}{n}},\,\,\,\, \hat{p} + z^*\cdot \sqrt{\cfrac{\pi_0\cdot(1-\pi_0)}{n}} \bigg)\]

For a given *confidence level *#C# (in #\%#), the *critical value* #z^*# of the standard normal distribution is the value such that #\mathbb{P}(-z^* \leq Z \leq z^*)=\cfrac{C}{100}#.

To calculate this critical value #z^*# in R, make use of the following function:

qnorm(p, mean, sd, lower.tail)

p: A probability corresponding to the normal distribution.mean: The mean of the distribution.sd: The standard deviation of the distribution.lower.tail: If TRUE (default), probabilities are #\mathbb{P}(X \leq x)#, otherwise, #\mathbb{P}(X \gt x)#.

Here, we have #C=90#. Thus, to calculate #z^*#such that #\mathbb{P}(-z^* \leq Z \leq z^*)=0.90#, run the following command:

\[\begin{array}{c}

\text{qnorm}(p = (100+C)/200, mean = 0, sd = 1, lower.tail = \text{TRUE})\\

\downarrow\\

\text{qnorm}(p =190/200, mean = 0, sd = 1, lower.tail = \text{TRUE})

\end{array}\]

This gives:

\[z^* = 1.6449\]

Calculate the lower bound #L# of the confidence interval:

\[L = \hat{p} - z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.6875 - 1.6449 \cdot \sqrt{\cfrac{0.60 \cdot (1-0.60)}{112}} = 0.611\]

Calculate the lower bound #U# of the confidence interval:

\[U = \hat{p} + z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.6875 + 1.6449 \cdot \sqrt{\cfrac{0.60 \cdot (1-0.60)}{112}} = 0.764\]

Thus, the #90\%# confidence interval for the population proportion #\pi# is:

\[CI_{\pi,\,90\%}=(0.611,\,\,\, 0.764)\]

Based on this confidence interval, the null hypothesis #H_0: \pi = 0.60# *should* be rejected at the #\alpha = 0.10# level of significance because #\pi_0 = 0.60# falls *outside *of the confidence interval.

**Pass Your Math**independent of your university. See pricing and more.

Or visit omptest.org if jou are taking an OMPT exam.