Suppose I wish to calculate the sample size needed to detect a one percent change in a proportion that is normally at 35%. I don't mean 35% to 36%, I mean 35% to 35.35%. Here is the calculation in R blowing up:
> library(pwr)
> p2 = 0.35
> p1 = p2*1.01
> p1
[1] 0.3535
> h = 2 * asin(sqrt(p1)) - 2 * asin(sqrt(p2))
> alpha = 0.05
> beta = 0.05
> pwr.2p.test(h=h, sig.level=alpha, power = 1-beta)
Error in uniroot(function(n) eval(p.body) - power, c(2 + 1e-10, 1e+05)) :
f() values at end points not of opposite sign
Here is a 3% calculation succeeding and saying the sample needs to be of size 53,991:
> library(pwr)
> p2 = 0.35
> p1 = p2*1.03
> p1
[1] 0.3605
> h = 2 * asin(sqrt(p1)) - 2 * asin(sqrt(p2))
> alpha = 0.05
> beta = 0.05
> pwr.2p.test(h=h, sig.level=alpha, power = 1-beta)
Difference of proportion power calculation for binomial distribution (arcsine transformation)
h = 0.02194005
n = 53990.98
sig.level = 0.05
power = 0.95
alternative = two.sided
NOTE: same sample sizes
I accept all the assumptions above (same sample size, two-sided test, etc.). See here and here for more info on pwr.