I want to calculate the statistical power of a 2 sided A/B test where I have 2 groups of coin tosses (that is, from 2 different coins) and their respective successes. I want to test whether the two coins have different probabilities.
I'm following page 6 of https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/PASS/Tests_for_Two_Proportions.pdf, which follows the paper Chow et al. (2008) (I haven't found it online), and states that:
$$1 - \beta = Pr(Z < \frac{z_\alpha \sigma_{D,p} + (p_1 - p_2)}{\sigma_{D,u}})$$
where:
$n_1$ and $n_2$ are the respective number of coin tosses.
$s_1$ and $s_2$ are the respective successes.
$p_1 = s_1/n_1$, $p_2 = s_2/n_2$.
$q_1 = 1 - p_1, q_2 = 1 - p_2$.
$\sigma_{D,u}$ is the standard unpooled error: $\sqrt{\frac{p_1 q_1}{n_1} + \frac{p_2 q_2}{n_2}}$
$\bar{p} = \frac{n_1 p_1 + n_2 p_2}{n_1 + n_2}$, $\bar{q} = 1 - \bar{p}$.
$\sigma_{D,p}$ is the standard pooled error: $\sqrt{\bar{p} \bar{q} (\frac{1}{n_1} + \frac{1}{n_2})}$
and $z_\alpha$ seems to be the critical value.
I have no problems with the standard errors and I know I'm calculating them correctly. However, I know I'm not getting a correct statistical power as I compared my results to this tool and I'm getting other values.
I suspect I'm calculating $z_\alpha$ incorrectly. The book states the following:
"Find the critical value (or values in the case of a two-sided test) using the standard normal distribution. The critical value is that value of z that leaves exactly the target value of alpha in the tail."
I'm using $\alpha = 0.05$ (I want a confidence level of $0.95$). What value for $z_\alpha$ should I be using and why? I don't understand how to calculate the $z_\alpha$ that this book describes. I don't understand if, it being a 2 sided test, I should be doing 2 calculations.
For the record, let's assume:
$$n_1 = 81000$$
$$n_2 = 80000$$
$$s_1 = 1600$$
$$s_2 = 1696$$
where $n_1$ and $n_2$ are the respective number of coin tosses with each coin, and $s_1$ and $s_2$ are the respective number of successes.
In this example, as far as I know, the correct power should be (according to an online tool), 83.13%.
This it not for homework; I'm implementing a specialized open source tool and want to share it online.