Loss in power [Regulatives / Guidelines]

posted by Helmut Homepage – Vienna, Austria, 2017-05-06 19:31 (2539 d 08:50 ago) – Posting: # 17310
Views: 29,942

Hi mittyri and all,

R-code to estimate the loss in power (two groups of equal size). Example for my simulations above and assuming that we will get a significant Group-by-Treatment interaction at the level of the test.

library(PowerTOST)
CV          <- 0.3
theta0      <- 1
targetpower <- 0.8
p.level     <- 0.1
res         <- sampleN.TOST(CV=CV, theta0=theta0, targetpower=targetpower,
                            print=FALSE)
N           <- res[["Sample size"]]
if (N >= 12) { # at least minimum sample size acc. to GLs?
  pwr.mod3pooled <- res[["Achieved power"]]
} else {
  N <- 12
  pwr.mod3pooled <- power.TOST(CV=CV, theta0=theta0, n=N)
}
pwr.mod2       <- suppressMessages(power.TOST(CV=CV, theta0=theta0,
                                              n=N-1)*(1-p.level))
pwr.mod3groups <- power.TOST(CV=CV, theta0=theta0, n=N/2)*p.level
pwr.mod2and3   <- pwr.mod2+pwr.mod3groups
cat(sprintf("CV %5.3f%%, theta0 %.4f, targetpower %.2f%%    : sample size %i",
            100*CV, theta0, 100*targetpower, N),
    "\nLevel of the G\u00D7T test (model 1)                  :",
      sprintf("% 6.4f", p.level),
     "\nPower of studies evaluated by model 2 (pooled)   :",
      sprintf("%5.2f%%", 100*pwr.mod2),
    "\nPower of studies evaluated by model 3 (groups)   :",
      sprintf("%5.2f%%", 100*pwr.mod3groups),
    "\nModel 2 (pooled) and 3 (groups) combined         :",
      sprintf("%5.2f%%", 100*pwr.mod2and3),
    "\nPower of studies evaluated by model 3 (pooled)   :",
      sprintf("%5.2f%%", 100*pwr.mod3pooled),
    "\nLoss in power if simple model 3 cannot be applied:",
      sprintf("%5.2f%%", 100*(pwr.mod3pooled-pwr.mod2and3)), "\n")

Gives

CV 30.000%, theta0 1.0000, targetpower 80.00%    : sample size 32
Level of the G×T test (model 1)                  :  0.1000
Power of studies evaluated by model 2 (pooled)   : 71.80%
Power of studies evaluated by model 3 (groups)   :  3.25%
Model 2 (pooled) and 3 (groups) combined         : 75.05%
Power of studies evaluated by model 3 (pooled)   : 81.52%
Loss in power if simple model 3 cannot be applied:  6.47%


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
22,987 posts in 4,824 threads, 1,669 registered users;
90 visitors (0 registered, 90 guests [including 5 identified bots]).
Forum time: 04:22 CEST (Europe/Vienna)

The only way to comprehend what mathematicians mean by Infinity
is to contemplate the extent of human stupidity.    Voltaire

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