Initial sample size guess for the Potvin methods [Two-Stage / GS Designs]
Hi Hötzi,
That's why I included the remark:
I thought you'd be plugging in your own, but be that as it may.
An implementation of the function is here:
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.
❝ Error in Power.calc(nps1, GMR, CV, Is.St2 = 1) :
❝ 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
Pass or fail!
ElMaestro
Complete thread:
- Initial sample size guess for the Potvin methods ElMaestro 2017-08-19 15:04 [Two-Stage / GS Designs]
- Initial sample size guess for the Potvin methods Helmut 2017-08-19 16:06
- Initial sample size guess for the Potvin methodsElMaestro 2017-08-19 16:14
- Initial sample size guess for the Potvin methods Helmut 2017-08-19 17:12
- Initial sample size guess for the Potvin methods ElMaestro 2017-08-19 17:17
- Confuse-a-Cat Helmut 2017-08-19 17:33
- Confuse-a-Cat ElMaestro 2017-08-19 17:56
- Confuse-a-Cat Helmut 2017-08-19 17:33
- Initial sample size guess for the Potvin methods ElMaestro 2017-08-19 17:17
- loop ↔ vectorized ↔ direct Helmut 2017-08-20 14:40
- loop ↔ vectorized ↔ direct ElMaestro 2017-08-20 15:22
- loop ↔ vectorized ↔ direct Helmut 2017-08-20 16:23
- loop ↔ vectorized ↔ direct ElMaestro 2017-08-20 17:22
- loop ↔ vectorized ↔ direct Helmut 2017-08-20 16:23
- loop ↔ vectorized ↔ direct ElMaestro 2017-08-20 15:22
- Initial sample size guess for the Potvin methods Helmut 2017-08-19 17:12
- Initial sample size guess for the Potvin methodsElMaestro 2017-08-19 16:14
- The n ext crackpot iteration ElMaestro 2017-08-19 20:04
- The n ext crackpot iteration Helmut 2017-08-20 02:20
- The ultimate crackpot iteration! ElMaestro 2017-08-20 14:35
- The ultimate crackpot iteration! Helmut 2017-08-20 15:11
- The ultimate crackpot iteration! ElMaestro 2017-08-20 15:28
- The ultimate crackpot iteration! Helmut 2017-08-20 16:06
- The ultimate crackpot iteration! ElMaestro 2017-08-20 16:15
- The ultimate crackpot iteration! Helmut 2017-08-20 18:58
- The ultimate crackpot iteration! ElMaestro 2017-08-20 19:32
- Suggested code ElMaestro 2017-08-21 18:13
- Nitpicker! Helmut 2017-08-22 13:33
- Nitpicker! ElMaestro 2017-08-22 17:27
- Nitpicker! Helmut 2017-08-22 17:49
- Nitpicker! ElMaestro 2017-08-22 17:59
- Nitpicker! Helmut 2017-08-22 19:15
- Benchmark code ElMaestro 2017-08-22 22:29
- Benchmark code Helmut 2017-08-23 01:48
- Benchmark code ElMaestro 2017-08-22 22:29
- Nitpicker! Helmut 2017-08-22 19:15
- Nitpicker! ElMaestro 2017-08-22 17:59
- Nitpicker! Helmut 2017-08-22 17:49
- Nitpicker! ElMaestro 2017-08-22 17:27
- Nitpicker! Helmut 2017-08-22 13:33
- Suggested code ElMaestro 2017-08-21 18:13
- The ultimate crackpot iteration! ElMaestro 2017-08-20 19:32
- The ultimate crackpot iteration! Helmut 2017-08-20 18:58
- The ultimate crackpot iteration! ElMaestro 2017-08-20 16:15
- The ultimate crackpot iteration! Helmut 2017-08-20 16:06
- The ultimate crackpot iteration! ElMaestro 2017-08-20 15:28
- The ultimate crackpot iteration! Helmut 2017-08-20 15:11
- Initial sample size guess for the Potvin methods Helmut 2017-08-19 16:06