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:
$$p=\frac{0.05+0.07}{n_1+n_2}=\frac{0.12}{2n_1}$$
The expression for the pooled variance is:
$$\sigma=\frac{p(1-p)}{n_1}+\frac{p(1-p)}{n_2}$$
But since $n_1=n_2$ we get:
$$\sigma=\frac{2p(1-p)}{n_1}$$
We substitute $p$
$$\sigma=\frac{2\frac{0.12}{2n_1}(1-\frac{0.12}{2n_1})}{n_1}$$
$$\sigma=\frac{2(\frac{0.12}{2n_1}-(\frac{0.12}{2n_1})^2)}{n_1}=\frac{(\frac{0.24}{2n_1}-(\frac{2(0.12)^2}{4n_1^2}))}{n_1}=\frac{0.24}{2n_1^2}-(\frac{2(0.12)^2}{4n_1^3}))$$
We want to simplify this expression and gain a common denomitator so:
$$\frac{0.24(4n_1^3)}{2n_1^2(4n_1^3)}-\frac{2(0.12)^2(2n_1^2)}{4n_1^3(2n_1^2)}=\frac{0.24(2n_1)-2(0.12)^2}{4n_1^3}=\sigma^2$$
$$\sigma=\sqrt{\frac{0.24(2n_1)-2(0.12)^2}{4n_1^3}}$$
Now in order to calculate or z score, we write:
$$z=\frac{p_1-p_2}{\sigma}=1.96$$
$$=>\frac{0.02}{\sigma}=1.96$$
$$=>\frac{0.02}{1.96}=\sigma$$
$$=>(\frac{0.02}{1.96})^2=\sigma^2$$
$$=>(\frac{0.02}{1.96})^2=\frac{0.24(2n_1)-2(0.12)^2}{4n_1^3}$$
$$=>(\frac{0.02}{1.96})^2(4n_1^3)=0.24(2n_1)-2(0.12)^2$$
$$=>(\frac{0.02}{1.96})^2(4n_1^3)-0.24(2n_1)=-2(0.12)^2$$
$$=>(4n_1^3)-\frac{0.24(2n_1)}{(\frac{0.02}{1.96})^2}=-\frac{2(0.12)^2}{(\frac{0.02}{1.96})^2}$$
$$=>64(n_1^3)-4609.92n_1=276.5952$$
Questions:
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...
Given that this actually is correct, then how on earth do I solve for $n_1$?