I would like to do power analyses for hypothesis tests of (non-)equality of proportions in which the proportions are very small. I would like to do so without using normal (or Poisson) approximations of the binomial distribution. There are several general types of power questions I'd like to be able to address.
- Post-hoc: Given $\Pr_1$ (probability of a success in group 1) and $\Pr_2$ and $N_1$ (sample size group 1) and $N_2$ to calculate the power of the design given $\alpha$.
- A priori solve for $N$ given $\alpha$, the ratio $N_1\over{N_2}$, $1 - \beta$ (power), $\alpha$, $\Pr_1$, and an expected $\Pr_2$
- A priori solve for $1 - \beta$ given $\alpha, N_1, N_2, \Pr_1$, and $\Pr_2$.
An ideal response would include R code and point out any other givens that I forgot to point out. A simulation approach is not a suitable response due to the small proportions. With your solution, please also mention what kind of statistical test it is applicable to.