### Chapter 8. Testing for Differences in Mean and Proportion: Independent Proportions Z-test

### Confidence Interval for the Difference Between Two Independent Proportions

Confidence Interval for the Difference Between Two Independent Proportions

Assuming the *sampling distribution of the difference between two sample proportions *is (approximately) normal, the general formula for computing a #C\%\,CI# for the difference between the two population proportions #\pi_1- \pi_2# is:

\[CI_{(\pi_1 - \pi_2)}=(\hat{p}_1 - \hat{p}_2) \pm z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\]

Where* *#z^*# is the **critical value **of the *Standard Normal Distribution* such that #\mathbb{P}(-z^* \leq Z \leq z^*) = \cfrac{C}{100})#.

Calculating z* with Statistical Software

Let #C# be the *confidence level *in #\%#.

To calculate the *critical value* #z^*# in Excel, make use of the function **NORM.INV()**:

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

To calculate the *critical value* #z^*# in R, make use of the function **qnorm()**:

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

Construct a #93\%# confidence interval for the difference between the two population proportions #\pi_1 - \pi_2#. Round your answers to #3# decimal places.

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

Since both #n_1# and #n_2# are considered *large *(#\gt 30#), the *Central Limit Theorem *applies and we know that the *sampling distribution of the difference between two sample proportions *is (approximately) normal.

If the *sampling distribution of the difference between two sample proportions *is (approximately) normal, the general formula for computing a #C\%\,CI# for the difference between the two population proportions #\pi_1- \pi_2# is:

\[CI_{(\pi_1 - \pi_2)}=(\hat{p}_1 - \hat{p}_2) \pm z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\]

Compute the *sample proportions* #\hat{p}_1# and #\hat{p}_2#:

\[\hat{p}_1=\cfrac{X_1}{n_1}=\cfrac{36}{90}=0.40000\\

\hat{p}_2=\cfrac{X_2}{n_2}=\cfrac{27}{100}=0.27000\]

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

\[\begin{array}{c}

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

\downarrow\\

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

\end{array}\]

This gives:

\[z^* = 1.81191\]

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

\[\begin{array}{rcl}

L &=& (\hat{p}_1 - \hat{p}_2) - z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\\

&=& (0.40000 - 0.27000) - 1.81191 \cdot \sqrt{\cfrac{0.40000 \cdot (1 - 0.40000)}{90}+\cfrac{0.27000 \cdot (1 - 0.27000)}{100}}\\

&=&0.007

\end{array}\]

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

\[\begin{array}{rcl}

U &=& (\hat{p}_1 - \hat{p}_2) + z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\\

&=& (0.40000 - 0.27000) + 1.81191 \cdot \sqrt{\cfrac{0.40000 \cdot (1 - 0.40000)}{90}+\cfrac{0.27000 \cdot (1 - 0.27000)}{100}}\\

&=&0.253

\end{array}\]

Thus, the #93\%# confidence interval for the difference between the two population proportions #\pi_1 - \pi_2# is:

\[CI_{(\pi_1 - \pi_2),\,93\%}=(0.007,\,\,\, 0.253)\]

Since both #n_1# and #n_2# are considered *large *(#\gt 30#), the *Central Limit Theorem *applies and we know that the *sampling distribution of the difference between two sample proportions *is (approximately) normal.

If the *sampling distribution of the difference between two sample proportions *is (approximately) normal, the general formula for computing a #C\%\,CI# for the difference between the two population proportions #\pi_1- \pi_2# is:

\[CI_{(\pi_1 - \pi_2)}=(\hat{p}_1 - \hat{p}_2) \pm z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\]

Compute the *sample proportions* #\hat{p}_1# and #\hat{p}_2#:

\[\hat{p}_1=\cfrac{X_1}{n_1}=\cfrac{36}{90}=0.40000\\

\hat{p}_2=\cfrac{X_2}{n_2}=\cfrac{27}{100}=0.27000\]

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

\end{array}\]

This gives:

\[z^* = 1.81191\]

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

\[\begin{array}{rcl}

L &=& (\hat{p}_1 - \hat{p}_2) - z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\\

&=& (0.40000 - 0.27000) - 1.81191 \cdot \sqrt{\cfrac{0.40000 \cdot (1 - 0.40000)}{90}+\cfrac{0.27000 \cdot (1 - 0.27000)}{100}}\\

&=&0.007

\end{array}\]

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

\[\begin{array}{rcl}

U &=& (\hat{p}_1 - \hat{p}_2) + z^*\cdot \sqrt{\cfrac{\hat{p}_1 \cdot (1 - \hat{p}_1)}{n_1}+\cfrac{\hat{p}_2 \cdot (1 - \hat{p}_2)}{n_2}}\\

&=& (0.40000 - 0.27000) + 1.81191 \cdot \sqrt{\cfrac{0.40000 \cdot (1 - 0.40000)}{90}+\cfrac{0.27000 \cdot (1 - 0.27000)}{100}}\\

&=&0.253

\end{array}\]

Thus, the #93\%# confidence interval for the difference between the two population proportions #\pi_1 - \pi_2# is:

\[CI_{(\pi_1 - \pi_2),\,93\%}=(0.007,\,\,\, 0.253)\]

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

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