## Hypothesis Tests for One or Two Proportions

When testing a claim about the value of a population proportion, the requirements for approximating a binomial distribution with a normal distribution are needed. That is, for a sample of size $n$ with a claimed population proportion of $p_0$, then we require   $np_0 \ge 5$   and   $n(1-p_0) \ge 5$.

### Testing a Single Proportion

If the approximation requirements are met, then the test statistic will follow the standard normal distribution, and is given by the following formula.

 $z = \dfrac{\hat{p} - p_0}{\sqrt{p_0 (1-p_0)/n}}$

Suppose minorities form 29% of a local population. A local business has 125 employees, of which 28 are minorities. Did the business discriminate in its hiring practices?

• The hypotheses are:
$H_0: p = 0.29$
$H_a: p \ne 0.29$ (Note that the direction of discrimination was not stated.)
• We shall choose   $\alpha = 0.05$.
• The sample proportion is $\hat{p} = \dfrac{28}{125} = 0.224$.
The test statistic is   $z = \dfrac{\hat{p} - p_0}{\sqrt{p_0 (1-p_0)/n}} = \dfrac{0.224 - 0.29}{\sqrt{0.29(1-0.29)/125}} = -1.626$.
• The p-value is   $p = 2\times \operatorname{normalcdf}(-\infty,-1.626) = 0.1039$.
• Since   $p > \alpha$,   we fail to reject $H_0$.
• There is insufficient evidence to conclude that the business was discriminating in its hiring practices.

### Testing the Difference of Two Proportions

If two proportions are being tested against one another (rather than one against a claimed value), then the test statistic is defined somewhat differently. Suppose $d_0$ is the claimed difference between the two proportions. (If the claim is that the proportions are equal, then   $d_0 = 0$.)   Let the two sample proportions be denoted by $\hat{p_1}$ and $\hat{p_2}$, and their combined proportion as   $\hat{p} = \dfrac{x_1 + x_2}{n_1 + n_2}$.   The same assumptions are required. The test statistic will have a standard normal distribution, and its formula is:

 $z = \dfrac{(\hat{p_1} - \hat{p_2}) - d_0}{\sqrt{\hat{p} (1-\hat{p}) \left(\dfrac{1}{n_1} + \dfrac{1}{n_2} \right)}}$

Suppose a sample of 200 New York voters found 88 who voted for the Republican presidential candidate, while a sample of 300 California voters found 143 who voted for the same candidate. Test the claim that there is no difference between the two states in the proportions who favored the Republican candidate.

• The hypotheses are:
$H_0: p_1 = p_2$,   or   $H_0: d = 0$
$H_a: p_1 \ne p_2$,   or   $H_a: d \ne 0$
• We shall choose   $\alpha = 0.05$.
• The sample proportions are   $\hat{p_1} = \dfrac{88}{200} = 0.44$,   $\hat{p_2} = \dfrac{143}{300} = 0.4767$,   and   $\hat{p} = \dfrac{88+143}{200+300} = 0.462$.
The test statistic is   $\dfrac{(\hat{p_1} - \hat{p_2}) - d_0}{\sqrt{\hat{p} (1-\hat{p}) \left(\dfrac{1}{n_1} + \dfrac{1}{n_2} \right)}} = \dfrac{(0.44 - .4767) - 0}{\sqrt{0.462(1-0.462)\left( \dfrac{1}{200} + \dfrac{1}{300} \right)}} = -0.8057$.
• The p-value is   $p = 2\times \operatorname{normalcdf}(-\infty,-0.8057) = 0.4204$.
• Since   $p > \alpha$,   we fail to reject $H_0$.
• There is insufficient evidence to conclude that New York and California have different proportions of voters favoring the Republican presidential candidate.