My brother is comparing a number of advertisement campaings. He wants to know how large the samples must be in order to determine whether a 2 percent difference between twp proportions is going to be significant.

He assures me that he will organize the campaings so that the sample sizes are equal. He told me to use success of 5 and 7 percent for the calculation.

I've tried to work this out myself, as follows:

In order to calculate the pooled variance we first need the pooled proportion, so:


The expression for the pooled variance is:


But since $n_1=n_2$ we get:


We substitute $p$



We want to simplify this expression and gain a common denomitator so:



Now in order to calculate or z score, we write:











  1. Is this even the correct answer? I would really prefer not having to solve a cubic equation every time I need to figure out a simple sample size...

  2. Given that this actually is correct, then how on earth do I solve for $n_1$?


2 Answers 2


In order to find sample size, in addition to the difference in proportions (given as .02), you need significance level (I suppose 5%) and desired power (let's say 80% or 90%). You do not state a target power, nor give enough explanation along with your computations to make your strategy clear (not to me, anyhow). So I can't say how to simplify your approach.

Using a recent release of Minitab, we get the following output, showing that you need sample sizes of between 2200 and 3000 in each group. [Most statistical software has 'power and sample size' procedures, and there are on-line sample size calculators (of varying accuracy and ease of use).]

Power and Sample Size 

Test for Two Proportions

Testing comparison p = baseline p (versus ≠)
Calculating power for baseline p = 0.05
α = 0.05

              Sample  Target
Comparison p    Size   Power  Actual Power
        0.07    2213     0.8      0.800142
        0.07    2962     0.9      0.900095

The sample size is for each group.

enter image description here

If you can guess the approximate value of $n$ (maybe roughly as $n \approx 1/\delta^2,$ where $\delta = .02$ here), then you can do a simple simulation in R to see the resulting power. [In R the test of two binomial proportions is prop.test.]

n = 2700
pv = replicate(10^4, 
              prop.test(c(rbinom(1,n,.05),rbinom(1,n,.07)), c(n,n))$p.val)
mean(pv <= .05)
[1] 0.8608     # power

This will probably be downvoted but according to my current understanding, this is the correct answer.

To put it simply, in the very first formula I assumed that: $$p=\frac{p_1+p_2}{n_1+n_2}$$

This is incorrect, and it should read:


...Where $x_1$ denotes the number of "successes" in $n_1$ and vice versa.

Since we know that $\frac{x_1}{n2}=0.05$ and that $\frac{x_2}{n2}=0.05$ it must follow that $\frac{x_1+x_2}{n_1}=0.12$ if the samples are equal. The expression for the common proportion is almost equal, apart from the fact that the demoninator is twice as big:


Which implies that:


In which case the next steps can be significantly simplified:


If we skip a few steps, this means that:



....Which adds up to an $n_1$ of 270.8 or 271 rounded up.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.