maximum sample size at which CV? [🇷 for BE/BA]

posted by Helmut Homepage – Vienna, Austria, 2016-01-26 17:31 (3446 d 21:53 ago) – Posting: # 15856
Views: 18,344

Dear Shuanghe,

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]
Interesting shape!

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,427 posts in 4,929 threads, 1,678 registered users;
60 visitors (0 registered, 60 guests [including 27 identified bots]).
Forum time: 16:25 CEST (Europe/Vienna)

Half the harm that is done in this world
Is due to people who want to feel important.    T. S. Eliot

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