11.5: Comparing Two Proportions
- Page ID
- 20917
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)In Chapter 10, we covered the test for comparing a proportion to a hypothesized value. In this section we want to explore a test to compare two population proportions.
Like testing means, the usual null hypothesis will be that proportions are the same. We will usually denote each of the two proportions with a subscript, say 1 and 2. Here are some possible two‐tailed and one‐tailed Hypotheses:
\(\begin{array}{lll}
H_o: p_{1}=p_{2} & H_o: p_{1} \geq p_{2} & H_o: p_{1} \leq p_{2} \\
H_a: p_{1} \neq p_{2} & H_a: p_{1}<p_{2} & H_a: p_{1}>p_{2}
\end{array} \)
Notice that the Null Hypothesis can be written as \(H_o: p_{1}-p_{2}=0\), meaning we want to look at the distribution of the difference of sample proportions as a random variable.
Distribution of difference of sample proportions
Suppose we take a sample of \(n_1\) from population 1 and \(n_2\) from population 2. Let \(X_1\) be the number of success in sample 1 and \(X_2\) be the number of success in sample 2.
\(\hat{p}_{1}=\dfrac{X_{1}}{n_{1}}\) represents the proportion of successes in sample 1
\(\hat{p}_{2}=\dfrac{X_{2}}{n_{2}}\) represents the proportion of successes in sample 2
As long as there are at least 10 successes and 10 failures in each sample, then the difference of sample proportions \(\hat{p}_{1}-\hat{p}_{2}\) will have a Normal Distribution.
- \(\mu_{\hat{p}_{1}-\hat{p}_{2}}=p_{1}-p_{2}\)
- \(\sigma_{\hat{p}_{1}-\hat{p}_{2}}=\sqrt{\dfrac{p_{1}\left(1-p_{1}\right)}{n_{1}}+\dfrac{p_{2}\left(1-p_{2}\right)}{n_{2}}}\)
- If \(n 1 p 1, n 1(1-p 1), n 2 p 2, n 2(1-p 2)\) are all at least 10, then the Probability Distribution of \(\hat{p}_{1}-\hat{p}_{2}\) is approximately Normal.
Combining all of the above into a single formula:
\[Z=\dfrac{\left(\hat{p}_{1}-\hat{p}_{2}\right)-\left(p_{1}-p_{2}\right)}{\sqrt{\frac{p_{1}\left(1-p_{1}\right)}{n_{1}}+\frac{p_{2}\left(1-p_{2}\right)}{n_{2}}}} \nonumber \]
Example: Left handedness by gender
12% of North Americans claim left‐handedness. With regard to gender, men are slightly more likely than women to be left‐handed, with most studies indicating that about 13% of men and about 11% of women are left‐handed82.
\(p_m\) = 0.13 = proportion of men who are left‐handed
\(p_w\) = 0.11 = proportion of women who are left‐handed
\(p_m ‐ p_w\) = difference in proportion of men and women who are left‐handed
Solution
Suppose we take a sample of 100 men and 150 women. Let's investigate the random variable \(\hat{p}_{m}-\hat{p}_{w}\)
100(0.13) = 13 100(1‐0.13) = 87
150(0.11) = 16.5 150(1‐0.11) = 133.5
Since all values are greater than 10, \(\hat{p}_{m}-\hat{p}_{w}\)has approximately a normal distribution.
\(\mu_{\hat{p}_{m}-\hat{p}_{w}}=0.13-0.11=0.02\)
\(\sigma_{\hat{p}_{m}-\hat{p}_{w}}=\sqrt{\dfrac{0.13(1-0.13)}{100}+\dfrac{0.11(1-0.11)}{150}}=0.0422\)
Hypothesis test for difference of proportions
In conducting a Hypothesis test where the Null hypothesis assumes equal proportions, it is best practice to pool or combine the sample proportions into a single estimated proportion \(\bar{p}\), and use an estimated standard error, \(S_{\hat{p}_{m}-\hat{p}_{w}}\):
\(\bar{p}=\dfrac{X_{1}+X_{2}}{n_{1}+n_{2}}\)
\(s_{\hat{p}_{1}-\hat{p}_{2}}=\sqrt{\dfrac{\bar{p}(1-\bar{p})}{n_{1}}+\dfrac{\bar{p}(1-\bar{p})}{n_{2}}}\)
The test statistic will have a Normal Distribution as long as there are at least 10 successes and 10 failures in both samples.
\(Z=\dfrac{\left(\hat{p}_{1}-\hat{p}_{2}\right)-\left(p_{1}-p_{2}\right)}{\sqrt{\frac{\bar{p}(1-\bar{p})}{n_{1}}+\frac{\bar{p}(1-\bar{p})}{n_{2}}}}\)
Example: Background checks at gun shows
Under current United States law, private sales between owners are exempt from background check requirements. This is sometimes called the "Gun Show Loophole" as it may allow criminals, terrorists and the mentally ill to purchase assault weapons, such as those used in mass shootings.83
In an August 2016 Study, Pew Research analyzed American's opinions about gun laws and rights.84 Pew took a representative sample of 990 men and 1020 women and asked them several questions. In particular, they asked the sampled Americans if background checks required at gun stores should be made universal and extended to all sales of guns between private owners or at gun shows. 772 out 990 men said yes, while 857 out of 1020 women said yes.
Is there a difference in the proportion of men and women who support universal background checks for purchasing guns? Design and conduct the test with a significance level of 1%.
Solution
Design
\(H_{o}: p_{m}=p_{w}\) (There is no difference in the proportion of support for background checks by gender)
\(H_{a}: p_{m} \neq p_{w}\) (There is a difference in the proportion of support for background checks by gender)
Model: Two proportion \(Z\) test. This is a two‐tailed test with \(\alpha\) = 0.01.
Model Assumptions: for men there are 772 yes and 218 no. For women there are 857 yes and 163 no. Since all these numbers exceed 10, the model is appropriate.
Decision Rules:
Critical Value Method ‐ Reject \(H_o\) if \(Z\) > 2.58 or \(Z\) < ‐2.58.
\(P\)‐value method ‐ Reject \(H_o\) if \(p\)‐value <0.01
Data/Results
\(\hat{p}_{m}=\dfrac{772}{990}=0.780 \qquad \hat{p}_{w}=\dfrac{857}{1020}=0.840 \qquad \bar{p}=\dfrac{772+857}{990+1020}=0.810\)
\(Z=\dfrac{(0.780-0.840)-0}{\sqrt{\frac{0.810(1-0.810)}{990}+\frac{0.810(1-0.810)}{1020}}}=-3.45 \mathrm{p} \text {-value }=0.0005<\alpha\)
Reject \(H_o\) under both methods
Conclusion
There is a difference in the proportion of support for background checks by gender. Women are more likely to support background checks.