# Chapter 2 Two-sample test of proportions

If we wish to compare two proportions from different (independent) populations, we can use the two-sample test of proportions. For example, suppose we wish to know whether there is a significant difference in the proportion of US adults who say they use Facebook between two groups: those aged 18-29, and those aged 30-49. Consider the hypotheses

$H_0 : p_1 = p_2 \text{ versus } H_1 : p_1 \neq p_2,$

where:

• $$p_1$$ denotes the proportion of US adults aged 18-29 who say they use Facebook
• $$p_2$$ denotes the proportion of US adults aged 30-49 who say they use Facebook

For a two-sample test of proportions, we also have that the sample sizes chosen from each population (or group) are $$n_1$$ and $$n_2$$ respectively, and that in the first sample, $$x_1$$ individuals exhibit the trait of interest, and in the secong sample $$x_2$$ individuals exhibit the trait of interest. The estimated proportions are

$\hat{p}_1 = \frac{x_1}{n_1} \text{ and } \hat{p}_2 = \frac{x_2}{n_2}.$

A survey was carried out to better understand Americans' use of social media, online platforms, and messaging apps. Supposing that of the $$n_1 = 220$$ and $$n_2 = 416$$ respondents from each group respectively, $$x_1 = 154$$ and $$x_2 = 320$$ said they used Facebook, we have that

• $$\hat{p}_1 = \displaystyle \frac{x_1}{n_1} = \frac{154}{220} = 0.7$$
• $$\hat{p}_2 = \displaystyle \frac{x_2}{n_2} = \frac{320}{416} = 0.77$$.

From these sample proportions, we can see that 70% of 18-29 year olds say they use Facebook, compared with 77% of 30-49 year olds. In the following sections, we will see whether this difference is statistically significant.

### References

Auxier, Brooke, and Monica Anderson. 2021. “Social Media Use in 2021.” Pew Research Center. 2021. https://www.pewresearch.org/internet/2021/04/07/social-media-use-in-2021/.