Avoid Excel! [Power / Sample Size]

posted by Helmut Homepage – Vienna, Austria, 2014-06-23 16:08 (4385 d 15:16 ago) – Posting: # 13126
Views: 8,348

Hi Aflores,

❝ I'm working on an Excel project that would calculate Power for a sequential BE, based on the journal from Potvin, et al. […] the =NORMSDIST(x) function seemed to be incorrect for this purpose.


Avoid Excel! BTW, you are not interested in the standard normal distribution – the function you are looking for is TINV(p, df). Potvin et al. claim in their paper to have used the method of Hauschke et al. (1992).1 Note that this is onlyI would not use it whenever possible. See what we get in the first stage of Potvin’s Example 2:

      method       % power 
───────────────────────────
shifted central t   50.49  
noncentral t        52.16  
exact               52.51  
───────────────────────────


I recommend to use the freeware R / package PowerTOST … instead of recreating the wheel in a lousy software.

If you are interested in setting up your own simulations (let’s say the T/R-ratio, target power, or accep­t­ance range are not covered in one of the publications) maybe you are interested in this thread. Note that the convergence of empiric α (i.e., simulating at T/R 1.25) is slow. You need 106 simulations to get a stable estimate. Sim’s of empiric power (i.e., simulating at the expected T/R) con­verge faster; 105 sim’s are sufficient. Results obtained by Power2Stage / function Power.2stage generally agree2 with results reported by Potvin et al. (the few differences might be due to different seeds of the pseudo-random number generator).

n1  CV%    a      b      c      n1  CV%    a      b      c   
─────────────────────────────────────────────────────────────
12   10  0.0297 0.0294 0.0294   12   60  0.0297 0.0299 0.0299
24   10  0.0294 0.0292 0.0292   24   60  0.0307 0.0308 0.0309
36   10  0.0294 0.0293 0.0293   36   60  0.0333 0.0332 0.0332
48   10  0.0292 0.0293 0.0293   48   60  0.0399 0.0399 0.0399
60   10  0.0292 0.0293 0.0293   60   60  0.0466 0.0466 0.0466
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
12   20  0.0463 0.0463 0.0463   12   70  0.0294 0.0293 0.0293
24   20  0.0320 0.0315 0.0315   24   70  0.0299 0.0305 0.0305
36   20  0.0294 0.0294 0.0294   36   70  0.0306 0.0305 0.0305
48   20  0.0292 0.0293 0.0293   48   70  0.0328 0.0325 0.0325
60   20  0.0297 0.0293 0.0293   60   70  0.0381 0.0379 0.0378
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
12   30  0.0437 0.0438 0.0437   12   80  0.0292 0.0293 0.0293
24   30  0.0475 0.0473 0.0475   24   80  0.0298 0.0300 0.0300
36   30  0.0397 0.0396 0.0396   36   80  0.0303 0.0300 0.0300
48   30  0.0324 0.0320 0.0321   48   80  0.0303 0.0300 0.0300
60   40  0.0296 0.0295 0.0295   60   80  0.0318 0.0319 0.0318
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
12   40  0.0344 0.0345 0.0342   12   90  0.0289 0.0291 0.0291
24   40  0.0433 0.0433 0.0431   24   90  0.0298 0.0301 0.0301
36   40  0.0485 0.0484 0.0486   36   90  0.0296 0.0298 0.0298
48   40  0.0458 0.0454 0.0456   48   90  0.0297 0.0299 0.0299
60   40  0.0409 0.0405 0.0406   60   90  0.0300 0.0302 0.0302
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
12   50  0.0309 0.0310 0.0311   12  100  0.0291 0.0290 0.0289
24   50  0.0338 0.0336 0.0336   24  100  0.0298 0.0299 0.0299
36   50  0.0420 0.0418 0.0418   36  100  0.0298 0.0297 0.0297
48   50  0.0484 0.0481 0.0483   48  100  0.0297 0.0297 0.0297
60   50  0.0483 0.0478 0.0478   60  100  0.0301 0.0296 0.0296
─────────────────────────────────────────────────────────────


In simulations with Power.2stage I suggest method="nct". Results are pretty close to the exact ones, but the code runs much faster. On the other hand the boost in speed by method="shifted" is negligible. The gain in accuracy by method="exact" is not worth the efforts. Comparison on my machine of “Method B”, n1 12, CV 20%; 106 sim’s each:
Method     alpha   runtime (min)
────────────────────────────────
shifted  0.046343     1.35      
nct      0.046262     1.50      
exact    0.046053    15.00      
────────────────────────────────


Good luck and happy coding!


  1. Hauschke D, Steinijans VW, Diletti E, Burke M. Sample Size Determination for Bioequivalence Assessment Using a Multiplicative Model. J Pharmacokin Biopharm. 1992;20(5):557–61.
  2. Empiric type I error for “Method B”, 106 sim’s each. Results obtained by Power2Stage (function Power.2stage) which are outside the 95% confidence interval of Potvin’s results (i.e., are sig­ni­fi­cantly different) are formatted in red.
    a: Potvin et al.
    b: Power2Stage v0.1-1; noncentral t
    c: Power2Stage v0.1-2 (experimental – not on CRAN yet); shifted t
    To calculate the 95% CI of a given value use this code (example 0.0297):
    x <- 0.0297
    cat(x, as.numeric(binom.test(x*1e6, 1e6, alternative='two.sided')$conf.int), "\n")

    which gives:
    0.0297 0.02936814 0.03003459

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,571 registered users;
142 visitors (0 registered, 142 guests [including 26 identified bots]).
Forum time: 07:24 CEST (Europe/Vienna)

Ignorance more frequently begets confidence
than does knowledge.    Charles Darwin

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5