We got two types of treatment (type 1 and type 2). In our opinion, type 2 treatment has a higher performance and we would like to show this with research.
We assume that type 1 treatment has a maximum of 60% success, and type 2 treatment is 80% successful.
We are interested in getting the smallest sample size that the test power will be 0.8. We must decide which test is appropriate and get the smallest sample size with simulations.
What I have so far:
Since this is a proportions test, I asume that the null hypothesis will be: $H_0: p_1 = p_2$ and the alternative hypothesis will be: $H_A: p_1 = 0.6, p_2 = 0.8$. Distribution of every person in type 1 treatment is Ber($p_1$) and in type 2 treatment Ber($p_2$). Therefore, the distribution of treatment success is Binomial.
For comparing two proportions I used the Z test ($Z = \frac{p_1 - p_2 - 0}{\sqrt{p(1-p)(\frac{1}{n1} + \frac{1}{n2})}}$ and got two critical values: 1.96 and -1.96.
I generated 1000 samples for each group under the alternative hypothesis (type 1 and type 2) and calculated test statistics for each sample. Finally, I checked how often were the test statistics in the rejection region. The first $n$ with $80\%$ of rejection is the sample size I am looking for.
My question:
Is my approach correct? Is there a better, more accurate way of solving this problem? Should I use two sample sizes i.e. should I loop over $n1$ and $n2$ for treatment one and two respectively?
power.prop.test()
in R ... $\endgroup$