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

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

#CI_{\pi,\,94\%}=(0.708,\,\,\, 0.846)#

Based on this confidence interval, the null hypothesis #H_0: \pi = 0.75# *should not* be rejected at the #\alpha = 0.06# level of significance because #\pi_0 = 0.75# 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{108}{139}=0.7770\]

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

\[\begin{array}{c}

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

\downarrow\\

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

\end{array}\]

This gives:

\[z^* = 1.8808\]

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

\[L = \hat{p} - z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7770 - 1.8808 \cdot \sqrt{\cfrac{0.75 \cdot (1-0.75)}{139}} = 0.708\]

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

\[U = \hat{p} + z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7770 + 1.8808 \cdot \sqrt{\cfrac{0.75 \cdot (1-0.75)}{139}} = 0.846\]

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

\[CI_{\pi,\,94\%}=(0.708,\,\,\, 0.846)\]

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

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

\[\hat{p}=\cfrac{X}{n}=\cfrac{108}{139}=0.7770\]

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

\end{array}\]

This gives:

\[z^* = 1.8808\]

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

\[L = \hat{p} - z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7770 - 1.8808 \cdot \sqrt{\cfrac{0.75 \cdot (1-0.75)}{139}} = 0.708\]

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

\[U = \hat{p} + z^*\cdot \sqrt{\cfrac{\hat{p}\cdot(1-\hat{p})}{n}} = 0.7770 + 1.8808 \cdot \sqrt{\cfrac{0.75 \cdot (1-0.75)}{139}} = 0.846\]

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

\[CI_{\pi,\,94\%}=(0.708,\,\,\, 0.846)\]

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