Confidence interval around the ratio of two proportions I have two proportions (e.g., clickthrough rate (CTR) on a link in a control layout, and CTR on a link in an experimental layout), and I want to calculate a 95% confidence interval around the ratio of these proportions.
How do I do this? I know I can use the delta method to calculate the variance of this ratio, but I'm not sure what to do besides that. What should I use as the midpoint of the confidence interval (my observed ratio, or the expected ratio which is different), and how many standard deviations around this ratio should I take?
Should I be using the delta method variance at all? (I don't really care about the variance, just a confidence interval.) Should I use Fieller's Theorem, using Case 1 (since I'm doing proportions, I guess I satisfy the normal distribution requirement)? Should I just calculate a bootstrap sample?
 A: The standard way to do this in epidemiology (where a ratio of proportions is usually referred to as a risk ratio) is to first log-transform the ratio, calculate a confidence interval on the log scale using the delta method and assuming a normal distribution, then transform back. This works better in moderate sample sizes than using the delta method on the untransformed scale, though it will still behave poorly if the number of events in either group is very small, and fails completely if there are no events in either group.
If there are $x_1$ and $x_2$ successes in the two groups out of totals $n_1$ and $n_2$, then the obvious estimate for the ratio of proportions is $$\hat\theta = \frac{x_1/n_1}{x_2/n_2}.$$
Using the delta method and assuming the two groups are independent and the successes are binomially distributed, you can show that $$\operatorname{Var}(\log \hat\theta) = 1/x_1 - 1/n_1 +1/x_2 - 1/n_2.$$
Taking the square-root of this gives the standard error $\operatorname{SE}(\log \hat\theta)$. Assuming that $\log \hat\theta$ is normally distributed, a 95% confidence interval for $\log \theta$ is $$\log \hat\theta \pm 1.96 \operatorname{SE}(\log \hat\theta).$$
Exponentiating this gives a 95% confidence interval for the ratio of proportions $\theta$ as $$\hat\theta \exp\left[ \pm1.96 \operatorname{SE}(\log\hat\theta)\right].$$
