In the previous recipe, we checked if we could prove a difference in the population of smokers between a group of students. Now, we will check how many students we need to sample to observe a difference of 5 percent or 10 percent between smokers of each gender.
We will use the figures from the previous recipe, Testing two population proportions with the 2 Proportions test, but there is no need to open a dataset.
The following steps will find the number of male and female students that need to be included in a sample to be able to observe a difference in the proportion of smokers in each group of 0.05 or 0.1 with at least 80 percent or 90 percent power:
0.25
in the Baseline proportion (p2): field; in Comparison proportions (p1):, enter 0.15 0.2 0.3 0.35
..8 .9
.3.145.179.35