Tutorial [Power / Sample Size]

posted by Helmut Homepage – Vienna, Austria, 2020-05-05 12:45  – Posting: # 21401
Views: 4,016

Hi Alyssa,

» i will try to digest the PowerTOST calculation mentioned above.

Estimation, pleeze. ;-)

» I'm not a biostatistician.....so need some time. :cool:

It’s not that difficult; short tutorial:

library(PowerTOST)
# T/R-ratio, CVwR, and sample size from the PAR
theta0  <- 1.097
CVwR    <- 0.426
n       <- 41
design  <- "2x3x3"
# Since this was a partial replicate, we
# have to assume that CVwT = CVwR

CV      <- rep(CVwR, 2)

What was the – though irrelevant – post hoc power?

round(100 * power.scABEL(CV = CV, theta0 = theta0,
                         design = design, n = n), 2)

Gives

Unbalanced design. n(i)=14/14/13 assumed.
[1] 84.96

What’s the sample size applying all defaults (T/R-ratio 0.90, power 0.80, partial replicate design, 100,000 simulated studies)?

sampleN.scABEL(CV = CV)

Gives

+++++++++++ scaled (widened) ABEL +++++++++++
            Sample size estimation
   (simulation based on ANOVA evaluation)
---------------------------------------------
Study design: 2x3x3 (partial replicate)
log-transformed data (multiplicative model)
1e+05 studies for each step simulated.

alpha  = 0.05, target power = 0.8
CVw(T) = 0.426; CVw(R) = 0.426
True ratio = 0.9
ABE limits / PE constraint = 0.8 ... 1.25
EMA regulatory settings
- CVswitch            = 0.3
- cap on scABEL if CVw(R) > 0.5
- regulatory constant = 0.76
- pe constraint applied

Sample size search
 n     power
36   0.7642
39   0.7950
42   0.8198

OK, what about other designs/powers?

# partial replicate, 3- and 4-period full replicate designs
designs <- c("2x3x3", "2x2x3", "2x2x4")
# desired powers
target  <- c(0.80, 0.85, 0.90)
# assign a data.frame of results
res     <- data.frame(design = rep(designs, each = length(target)),
                      target = target, n = NA, power = NA)
# loop over the rows, apply the defaults:
# T/R-ratio 0.90, 100,000 simulated studies

for (j in 1:nrow(res)) {
  res[j, 3:4] <- sampleN.scABEL(CV = CV, design = res$design[j],
                                targetpower = res$target[j],
                                print = FALSE, details = FALSE)[8:9]
}
print(res, row.names = FALSE)

Gives

 design target  n   power
  2x3x3   0.80 42 0.81976
  2x3x3   0.85 48 0.86341
  2x3x3   0.90 57 0.90803
  2x2x3   0.80 44 0.80688
  2x2x3   0.85 52 0.85872
  2x2x3   0.90 62 0.90439
  2x2x4   0.80 28 0.80013
  2x2x4   0.85 34 0.86179
  2x2x4   0.90 40 0.90514


Sample sizes for the 3-period full replicate are higher than for the partial replicate. However, don’t think only about costs. The former is more informative, since you can estimate also CVwT. Not only that you learn something about your formulation, it is useful for designing other studies. Whereas expanding the limits is based on CVwR, the CI depends on the pooled variance of both treatments. In many cases CVwT < CVwR, which would give you an incentive of the sample size. Unfortunately CVwT is never given in PARs (not of regulatory concern). I recommend to perform pilot studies always in a full replicate design to obtain this information. Example:

# variance ratios T/R
ratio <- seq(0.75, 1, 0.05)
# variable CVwT and constant CVwR
CV    <- data.frame(CVwT = mse2CV(CV2mse(CVwR)*ratio),
                    CVwR = CVwR)
res   <- data.frame(CVwT = CV[, 1], CVwR = CV[, 2],
                    var.ratio = ratio, n = NA, power = NA)
# for heterogenicity (unequal variances)
# use the function sampleN.scABEL.sdsims()

for (j in 1:nrow(res)) {
  res[j, 4:5] <- sampleN.scABEL.sdsims(CV = as.numeric(CV[j, ]),
                                       design = "2x2x3", print = FALSE,
                                       details = FALSE)[8:9]
}
print(signif(res, 4), row.names = FALSE)

Gives

   CVwT  CVwR var.ratio  n  power
 0.3650 0.426      0.75 40 0.8135
 0.3778 0.426      0.80 40 0.8053
 0.3902 0.426      0.85 42 0.8119
 0.4024 0.426      0.90 42 0.8042
 0.4143 0.426      0.95 44 0.8114
 0.4260 0.426      1.00 44 0.8040

Although the expansion remains constant, with lower CVwT you will need less subjects.

But in your case we don’t have this information and have to assume that CVwT = CVwR. I recommend to perform a power analysis (see the vignette) to assess the impact of deviations from our assumptions on power. Try:

# defaults: T/R-ratio 0.90, target power 0.80,
# minimum acceptable power 0.70, partial replicate design

res <- pa.scABE(CV = CVwR)
print(res, plotit = FALSE)

Gives
Sample size plan scABE (EMA/ABEL)
 Design alpha  CVwT  CVwR theta0 theta1 theta2 Sample size Achieved power Target power
  2x3x3  0.05 0.426 0.426    0.9    0.8   1.25          42        0.81976          0.8

Power analysis
CV, theta0 and number of subjects which lead to min. acceptable power of at least 0.7:
 CV= 0.6668, theta0= 0.8718
 n = 31 (power= 0.7059)

Now:

plot(res, pct = FALSE, ratiolabel = "T/R")


[image]


Let’s explore the panels.
  1. If the CV will be higher than assumed, we gain power because we may expand the limits more. At ~50% power starts to drop because the upper cap of scaling and the restriction of the point estimate (within 80–125%) cuts in.
    If the CV will be lower than assumed, we loose power because we may expand the limits less. At 30% and below we may not expand the limits any more but at such low CVs the study will be sufficiently powered for ABE anyway.
  2. The T/R-ratio is the most sensitive condition. If it drops from the assumed 0.90 to 0.8718 (that’s a relative deviation of just 3.13%) power will already reach our minimum acceptable 0.70. Science is a cruel mistress.
  3. We don’t have to worry about dropouts at all.

Dif-tor heh smusma 🖖
Helmut Schütz
[image]

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

Complete thread:

Activity
 Admin contact
20,801 posts in 4,354 threads, 1,446 registered users;
online 9 (0 registered, 9 guests [including 6 identified bots]).
Forum time: 00:15 CEST (Europe/Vienna)

Medical statistician: One who will not accept that Columbus discovered America…
because he said he was looking for India in the trial plan.    Stephen Senn

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