### 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 #76# residents of the land of Oz, #55# of them were in favor of deposing the Wizard.

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

#CI_{\pi,\,99\%}=(0.588,\,\,\, 0.859)#

Based on this confidence interval, the null hypothesis #H_0: \pi = 0.70# *should not* be rejected at the #\alpha = 0.01# level of significance because #\pi_0 = 0.70# falls *inside* 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{55}{76}=0.7237\]

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=99#. Thus, to calculate #z^*# such that #\mathbb{P}(-z^* \leq Z \leq z^*)=0.99#, run the following command:

\[\begin{array}{c}

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

\downarrow\\

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

\end{array}\]

This gives:

\[z^* = 2.5758\]

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

\[L = \hat{p} - z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7237 - 2.5758 \cdot \sqrt{\cfrac{0.70 \cdot (1-0.70)}{76}} = 0.588\]

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

\[U = \hat{p} + z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7237 + 2.5758 \cdot \sqrt{\cfrac{0.70 \cdot (1-0.70)}{76}} = 0.859\]

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

\[CI_{\pi,\,99\%}=(0.588,\,\,\, 0.859)\]

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

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

\[\hat{p}=\cfrac{X}{n}=\cfrac{55}{76}=0.7237\]

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=99#. Thus, to calculate #z^*#such that #\mathbb{P}(-z^* \leq Z \leq z^*)=0.99#, 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 =199/200, mean = 0, sd = 1, lower.tail = \text{TRUE})

\end{array}\]

This gives:

\[z^* = 2.5758\]

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

\[L = \hat{p} - z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7237 - 2.5758 \cdot \sqrt{\cfrac{0.70 \cdot (1-0.70)}{76}} = 0.588\]

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

\[U = \hat{p} + z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7237 + 2.5758 \cdot \sqrt{\cfrac{0.70 \cdot (1-0.70)}{76}} = 0.859\]

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

\[CI_{\pi,\,99\%}=(0.588,\,\,\, 0.859)\]

Based on this confidence interval, the null hypothesis #H_0: \pi = 0.70# *should not* be rejected at the #\alpha = 0.01# level of significance because #\pi_0 = 0.70# falls *inside* 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.