File R1 R program for computing the critical values and power of the UMPT procedure for dispersion equivalence function(){ #USER SPECIFICATIONS PORTION alpha=0.05 #type I error rate n1=41 #sample sizes n2=46 thetau=16/9 #equivalence bound theta=1 #true theta #END OF SPECIFICATION df1=n1-1 df2=n2-1 thetal=1/thetau print("alpha, df1, df2, thetal, thetau") print(c(alpha,df1,df2,thetal,thetau)) critfunc=function(){ deltac=0.05 err=-alpha w1=sqrt(thetal*thetau) while (err<0){ w1=w1-deltac h=alpha+pf(w1/thetau,df1,df2) w2=qf(h,df1,df2)*thetau err=pf(w2/thetal,df1,df2)-pf(w1/thetal,df1,df2)-alpha} tol=1e-10 loopmax=1e03 w1l=w1 w1u=w1+deltac loop=0 while(abs(err)>tol & loop