CTU-Bern / presize

Precision Based Sample Size Calculation
https://ctu-bern.github.io/presize/
GNU General Public License v3.0
15 stars 12 forks source link

Equivalent of power for presize functions #95

Open aghaynes opened 2 years ago

aghaynes commented 2 years ago

Power is currently ca 50% - half the trials will find a larger CI

Could abuse the closed formulae to estimate the power...

> mu <- 5
> sd <- 2
> n <- 20
> presize::prec_mean(mu, sd, n)

     precision for mean 

  mean sd  n conf.width conf.level      lwr      upr
  1    5  2 20   1.872058       0.95 4.063971 5.936029

> power.t.test(delta = 0.94, sd = 2, power = .5, sig.level = .05, type = "one.sample")

     One-sample t test power calculation 

              n = 19.3697
          delta = 0.94
             sd = 2
      sig.level = 0.05
          power = 0.5
    alternative = two.sided

> power.t.test(delta = 0.94, sd = 2, power = .8, sig.level = .05, type = "one.sample")

     One-sample t test power calculation 

              n = 37.49745
          delta = 0.94
             sd = 2
      sig.level = 0.05
          power = 0.8
    alternative = two.sided
aghaynes commented 5 months ago

Paper: Probabilistic precision calculations for the planning of studies assessing negative binomial rates https://onlinelibrary.wiley.com/doi/10.1002/pds.5750 R code as supplement to the paper

Potential new rate method too?