Why not base 🇷? [Power / Sample Size]

posted by Helmut Homepage – Vienna, Austria, 2024-12-03 14:39 (215 d 15:10 ago) – Posting: # 24306
Views: 3,532

Hi Weidson,

the function CI.RatioF() can only handle parallel and 2×2×2 crossover designs but you have a replicate.
You mastered the evaluation in Excel. :-D
Alternatively an [image]-script following the FDA’s guidance (the raw data are given in Table AIV.6 of the 1995 guidance). The FDA took accurate calculations lightly (e.g., (–43.63 + –34.36) / 2  –38.99!).

m <- function(x, treatment, sites) { # Cave: only for complete data!
  (x$AUEC[x$treatment == treatment & x$site == sites[1]] +
   x$AUEC[x$treatment == treatment & x$site == sites[2]]) / 2
}
raw   <- read.delim(file = "https://bebac.at/downloads/FDA162457Example.csv")
sites <- unique(raw$site)
Y     <- data.frame(subject = unique(raw$subject),
                    T = m(raw, "T", sites), R = m(raw, "R", sites))
X.T   <- mean(Y$T)
X.R   <- mean(Y$R)
s2.TT <- var(Y$T)  # in the guidance standard deviation σ
s2.RR <- var(Y$R)  # but actually sample variances
s2.TR <- cov(Y$T, Y$R)
pe    <- X.T / X.R
n     <- nrow(Y)
t     <- qt(p = 0.95, df = n - 1)
G     <- t^2 * s2.RR / (n * X.R^2)
if (G >= 1) {
  cat("With G =", G, "the study does not meet the in vivo bioequivalence requirements.\n")
} else {
  K  <- pe^2 + s2.TT / s2.RR * (1 - G) + s2.TR / s2.RR * (G * s2.TR / s2.RR - 2 * pe)
  ci <- setNames(c(100 * ((pe - G * s2.TR / s2.RR) + c(1, -1) * t / X.R *
                           sqrt(s2.RR / n * K)) / (1 - G)), c("lower", "upper"))
  i  <- "With a 90% confidence interval of"
  p  <- "the study passed bioequivalence.\n"
  f  <- "the study failed to show bioequivalence.\n"
  if (ci[["lower"]] >= 80 & ci[["upper"]] <= 125) {
    cat(sprintf("%s %.1f\u2013%.1f%% %s", i, ci[["lower"]], ci[["upper"]], p))
  } else {
    cat(sprintf("%s %.1f\u2013%.1f%% %s", i, ci[["lower"]], ci[["upper"]], f))
  }
}

You should get:

With a 90% confidence interval of 53.6–165.9% the study failed to show bioequivalence.


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,680 registered users;
62 visitors (0 registered, 62 guests [including 15 identified bots]).
Forum time: 06:50 CEST (Europe/Vienna)

No matter what side of the argument you are on,
you always find people on your side
that you wish were on the other.    Thomas Berger

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