Initial sample size guess for the Potvin methods [Two-Stage / GS Designs]

posted by ElMaestro  – Denmark, 2017-08-19 18:14 (2435 d 12:27 ago) – Posting: # 17711
Views: 27,596

Hi Hötzi,

Error in Power.calc(nps1, GMR, CV, Is.St2 = 1) :

❝   could not find function "Power.calc"

❝ Did I specify the arguments wrongly?


That's why I included the remark:
##equation in Potvin et al.
I thought you'd be plugging in your own, but be that as it may.


An implementation of the function is here:

alpha1=0.0294
alpha2=0.05
vecQT1=c(1:5000)
vecQT2=c(1:5000)
for (i in 1:5000)
   {
    vecQT1[i]=qt(p=1-alpha1, df=i)
    vecQT2[i]=qt(p=1-alpha2, df=i)
   }



Power.calc=function(Nps, GMR, CV, Is.St2=0)
{
  s=sqrt(log(1+CV*CV))
  nom1=log(1.25/GMR)
  nom2=-log(1.25*GMR)
  den=s*sqrt(2/(2*Nps))
  df=Nps*2-2
  if (Is.St2==T) df=df-1
  ##cat("1-a=", 1-alpha, "df=",df,"\n")
  if (Is.St2==0) q=vecQT1[df]
    else         q=vecQT2[df]
  pw=pt( (nom1/den) -q, df) - pt( (nom2/den) +q, df)
  if (pw<0) pw=0.01
  return(pw)

}



Edit: Forgot to write: For classical B the alphas are (0.0294, 0.0294) and for C they are (0.05, 0.0294) though that isn't related to the topic. Second, Hötzi, you gave a little table which I am not very sure how to read. Note this isn't about the sample size calculation itself, this is about the initial guess used for the sample size calculation by up/down iteration.

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
22,988 posts in 4,825 threads, 1,654 registered users;
111 visitors (0 registered, 111 guests [including 8 identified bots]).
Forum time: 06:42 CEST (Europe/Vienna)

The whole purpose of education is
to turn mirrors into windows.    Sydney J. Harris

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