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

posted by ElMaestro  – Denmark, 2017-08-19 18:14 (2791 d 02:54 ago) – Posting: # 17711
Views: 29,508

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
23,422 posts in 4,927 threads, 1,668 registered users;
26 visitors (0 registered, 26 guests [including 13 identified bots]).
Forum time: 21:09 CEST (Europe/Vienna)

To know the history of science is to recognize the mortality
of any claim to universal truth.    Evelyn Fox Keller

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