Trials to a given precision; Sample size [Power / Sample Size]

posted by Ben – Germany, 2011-11-14 20:16 (5332 d 10:39 ago) – Posting: # 7672
Views: 12,030

Dear all,

in clinical development one often performs trials in order to estimate possible effects instead of testing whether there is a significant effect or not. Therefore one is more interested in the confidence interval itself and requires this to be no larger than a pre-specified width 2w. The question what sample size should be used boils down to solving w >= qantile*sqrt(Var(S)) iteratively, where Var(S) depends on n. As the focus is on the confidence interval it is however recommended to assure that with a certain probability 1-gamma (the so called coverage probability) the half-width of the CI is actually not greater than w, see Kupper and Hafner in their 1989 article "How Appro­pri­ate Are Popular Sample Size Formulas?" (The American Statistician, vol 43, pp 101-105). They consider the one-sample and the two-sample case. nQuery also has a way to calculate the desired sample size, but again only for a two group design (module MTG) and a 2x2 design (module MOC) (actually nQuery calls it paired design). So I tried to implement the procedure, extending it a little bit to allow for more possible designs (as in the function CVfromCI from the R package PowerTOST).

require(PowerTOST)
ss_ci <- function(w, sigma, design="2x2", alpha=0.1, gamma=0.05) {
# w is the desired precision
# 1-alpha is the confidence level
# 1-gamma is the coverage probability

# get degrees of freedom
# and design constant
# (copied from CVfromCI)
d.no <- .design.no(design)
if (is.na(d.no))
   stop("Unknown design!", call. = FALSE)
desi <- .design.props(d.no)
dfe <- parse(text = desi$df[1], srcfile = NULL)
bk <- desi$bk

# Calculate n: precision CI w/o coverage probability
#
n <- 1
while ( eval(dfe) < 1 ) {
  n <- n+1
}
n_start <- n
t_n <- qt(1-alpha/2, eval(dfe))

while ( n < bk*((sigma/w) * t_n)^2 ) {
  n <- n+1
  t_n <- qt(1-alpha/2, eval(dfe))
}
n_nocp <- n
cat("n w/o coverage probability = ", n_nocp, "\n")

# Calculate new n: precision CI with coverage probability
#
n <- n_start
chi <- qchisq(1-alpha, 1)
chi_n <- qchisq(1-gamma, eval(dfe))
f_n <- qf(1-alpha, 1, eval(dfe))

while ( bk*n*(n-1)/n_nocp < (chi_n*f_n)/chi ) {
  n <- n+1
  chi_n <- qchisq(1-gamma, eval(dfe))
  f_n <- qf(1-alpha, 1, eval(dfe))
}
cat("final n with coverage probability:", "\n")
return(n)
}


I played a little bit and some issues/questions came up.
  1. Using ss_ci with design "2x2", some precision w and sigma s I do not get the same sample sizes as nQuery's (version 6) paired means module MOC. I do get the same results as MOC (which by the way uses s*sqrt(2) as variability because it enables nQuery to use the same formula for both the two group design and the crossover design) when using the "parallel" design (with s as input variability). So the first two questions that pop into my mind are: Are my calculations in error or those of nQuery? Does nQuery use the correct degrees of freedom?
  2. The second issue I observed when using the 2x2 design is the following. As the half-width w decreases (less than or equal to 0.1 if sigma=0.2) and all other parameters remain the same the initial sample size (based only on w >= quantile*sqrt(Var(S))) will be larger than the final sample size that includeds the coverage probability. The reason for that is the new degrees of freedom, but this does not make any sense, does it?
  3. The final sample size in the 2x2 case will be less than the final sample size obtained from a 3x3, 4x4, 2x2x3 or a 2x2x4 design, which again does not make sense?
Is the whole approach nonsense or can this be fixed?

Best,
Ben

Complete thread:

UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,570 registered users;
136 visitors (0 registered, 136 guests [including 11 identified bots]).
Forum time: 07:56 CEST (Europe/Vienna)

Science is simply common sense at its best that is,
rigidly accurate in observation, and
merciless to fallacy in logic.    Thomas Henry Huxley

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