heliosdrm/pwr

Why does pwr.2p.test give different sample sizes than GPower and stats::power.prop.test?

deschen1 opened this issue · 2 comments

library(pwr)
pwr::pwr.2p.test(h = ES.h(0.022,0.001), sig.level = 0.05, power = 0.8, alternative = "greater")

gives:

     Difference of proportion power calculation for binomial distribution (arcsine transformation) 

              h = 0.2344905
              n = 224.8784
      sig.level = 0.05
          power = 0.8
    alternative = greater

NOTE: same sample sizes

But

stats::power.prop.test(p1 = 0.022, p2 = 0.001, sig.level = 0.05, power = 0.8, alternative = "one.sided")

gives:

     Two-sample comparison of proportions power calculation 

              n = 317.6901
             p1 = 0.022
             p2 = 0.001
      sig.level = 0.05
          power = 0.8
    alternative = one.sided

NOTE: n is number in *each* group

which btw is exactly the same result as obtained by GPower.

grafik

Any ideas, what's going on here?

The difference seems to come from the arsin transformation to calculate effect size h. Using the same feature in GPower yields the same results as in pwr.

That's right. Thanks for investigating it yourself. Since it's solved, I'll close this issue.