Tutorial [Power / Sample Size]
❝ i will try to digest the PowerTOST calculation mentioned above.
Estimation, pleeze.
❝ I'm not a biostatistician.....so need some time.
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)
round(100 * power.scABEL(CV = CV, theta0 = theta0,
design = design, n = n), 2)
Unbalanced design. n(i)=14/14/13 assumed.
[1] 84.96
sampleN.scABEL(CV = CV)
+++++++++++ 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
# 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)
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)
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
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)
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")
Let’s explore the panels.
- 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.
- 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.
- We don’t have to worry about dropouts at all.
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
Helmut Schütz
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Sample size calculation (Pilot study result vs literature) Alyssa 2020-05-04 04:35 [Power / Sample Size]
- Sample size calculation (Pilot study result vs literature) Dr_Dan 2020-05-04 08:46
- Sample size calculation (Pilot study result vs literature) Alyssa 2020-05-04 09:26
- Estimation of CVw and/or CVwR Helmut 2020-05-04 12:07
- Estimation of CVw and/or CVwR ElMaestro 2020-05-04 12:14
- Mea culpa! Helmut 2020-05-04 12:40
- It must be Myco ElMaestro 2020-05-04 13:46
- It is, it is! Helmut 2020-05-04 14:07
- It is.... Alyssa 2020-05-05 05:00
- TutorialHelmut 2020-05-05 12:45
- Tutorial Alyssa 2020-05-08 06:48
- library d_labes 2020-05-08 11:16
- Tutorial (from the start) Helmut 2020-05-08 13:08
- Tutorial (from the start) Alyssa 2020-05-12 04:05
- Tracking down error Helmut 2020-05-12 11:49
- Tracking down error: stringsAsFactors d_labes 2020-05-13 11:34
- R <4.0.0 Helmut 2020-05-13 12:07
- R <4.0.0 ElMaestro 2020-05-13 14:18
- R <4.0.0? Helmut 2020-05-13 14:21
- PowerTOST’s functions with as.character(design) d_labes 2020-05-13 18:50
- PowerTOST’s functions with as.character(design) Helmut 2020-05-13 18:55
- R <4.0.0 ElMaestro 2020-05-13 14:18
- R <4.0.0 Helmut 2020-05-13 12:07
- Tracking down error Alyssa 2020-05-15 05:08
- All’s well that ends well. Helmut 2020-05-15 10:52
- Tracking down error: stringsAsFactors d_labes 2020-05-13 11:34
- Tracking down error Helmut 2020-05-12 11:49
- Tutorial (from the start) Alyssa 2020-05-12 04:05
- Tutorial Alyssa 2020-05-08 06:48
- TutorialHelmut 2020-05-05 12:45
- It is.... Alyssa 2020-05-05 05:00
- It is, it is! Helmut 2020-05-04 14:07
- It must be Myco ElMaestro 2020-05-04 13:46
- Mea culpa! Helmut 2020-05-04 12:40
- Estimation of CVw and/or CVwR ElMaestro 2020-05-04 12:14
- Sample size calculation (Pilot study result vs literature) Dr_Dan 2020-05-04 08:46