maximum sample size at which CV? [🇷 for BE/BA]
adding a few lines of code to what Detlew wrote.
library(PowerTOST)
GMR <- seq(0.82, 0.95, 0.005)
CV <- seq(0.25, 0.35, 0.005)
n <- matrix(nrow=length(CV), ncol=length(GMR), byrow=TRUE,
dimnames=list(CV, GMR))
pwr <- n
for (j in seq_along(CV)) {
for (k in seq_along(GMR)) {
x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k],
design="2x2x4", print=FALSE,
details=FALSE)
if (is.na(x[["Sample size"]])) { # 2nd try if necessary
x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k],
design="2x2x4", print=FALSE,
details=FALSE, nstart=x[["nlast"]])
}
n[j, k] <- x[["Sample size"]]
pwr[j, k] <- x[["Achieved power"]]
}
}
print(n)
print(pwr)
max.n <- apply(n, 2, max) # maximum n for each GMR
min.pwr <- vector() # explore min. power
for (k in seq_along(GMR)) {
x <- n[, k]
y <- which(x == max.n[k]) # max. sample size(s)
if (length(y) == 1) { # already there
min.pwr[k] <- names(y)
} else { # pick the minimum
min.pwr[k] <- names(which(pwr[y, k] == min(pwr[y, k])))
}
}
min.pwr <- as.numeric(min.pwr)
shift <- diff(range(GMR))*0.01
plot(GMR, min.pwr, type="p", ylim=range(CV),
ylab="CV for maximum n", las=1)
abline(h=0.3, lty=3)
text(GMR-shift, min.pwr, labels=max.n,
cex=0.9, srt=90, pos=1, offset=1.6)
The maximum sample size within each GMR-column shows this strange behavior due the FDA’s combination of the regulatory constant log(1.25)/0.25, the PE-restriction, and the discontinuity (since RSABE can only be applied if CVwR ≥0.30). In the n-matrix you find the same maximum sample sizes in some GMR-columns. As Detlew pointed out, you can look at the minimum power to decide which one to select.
![[image]](img/uploaded/image369.png)
Interesting shape!
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- PowerTOST sample size FDA full replicate T/R ratio at 85% Shuanghe 2016-01-25 17:49 [🇷 for BE/BA]
- PowerTOST sample size FDA full replicate T/R ratio at 85% d_labes 2016-01-26 12:05
- PowerTOST sample size FDA full replicate T/R ratio at 85% Shuanghe 2016-01-26 12:55
- PowerTOST sample size FDA full replicate T/R ratio at 85% d_labes 2016-01-26 14:07
- maximum sample size at which CV?Helmut 2016-01-26 16:31
- maximum sample size at which CV? nobody 2016-01-26 17:40
- maximum sample size at which CV? d_labes 2016-01-27 08:41
- maximum sample size at which CV? nobody 2016-01-27 09:08
- OT: Stop - think -act d_labes 2016-01-27 09:31
- maximum sample size at which CV? nobody 2016-01-27 09:08
- maximum sample size at which CV? Shuanghe 2016-01-28 12:44
- target power 90% Helmut 2016-01-28 13:49
- PowerTOST update d_labes 2016-02-01 19:16
- #1,000 Helmut 2016-02-01 21:49
- OT: post #1,000 d_labes 2016-02-02 21:17
- #1,000 ElMaestro 2016-02-03 16:32
- #1,000 Helmut 2016-02-03 16:50
- OT: #1,000 d_labes 2016-02-05 15:50
- OT: #1,000 ElMaestro 2016-02-05 17:02
- OT: #1,000 d_labes 2016-02-05 19:48
- OT: #1,000 ElMaestro 2016-02-06 15:45
- OT: #1,000 nobody 2016-02-07 09:50
- OT: #1,000 ElMaestro 2016-02-06 15:45
- OT: #1,000 d_labes 2016-02-05 19:48
- OT: #1,000 ElMaestro 2016-02-05 17:02
- #1,000 Helmut 2016-02-01 21:49
- PowerTOST update d_labes 2016-02-01 19:16
- target power 90% Helmut 2016-01-28 13:49
- PowerTOST sample size FDA full replicate T/R ratio at 85% Shuanghe 2016-01-26 12:55
- PowerTOST sample size FDA full replicate T/R ratio at 85% d_labes 2016-01-26 12:05