The following equation provides the test statistic used in the Test of Proportions.
For a proposed a/b test, I am attempting to show the minimum value needed for the treated group (p2) to show a statistical significance at a 95% confidence level. In other words, I am trying to solve this equation for p2. Given that I know my total population size, the percent that will be treated, and Z-value, this would seem to be straightforward. However, I am getting stuck on the algebra.
I have written an R script that will run through a range of values for p2 until a p-value of a given confidence is met, but that is a sloppy way of solving the problem.