subroutine conflm(xbar,n,mu,sigma,level) real xbar,mu,sigma,level integer n c c A confidence interval on the sample mean. c Returns the "level" (percent) at which one can be confident c that the sample of 'N' measurements which produced Xbar, came c from a population DIFFERENT FROM a population with mean 'Mu' c and variance 'Sigma'. Note that this is a test of the sample c mean only -- it does not involve or test the sample varience. c c Generally: c xbar - mu c --------------- ~ N(0,1); ie, Std. Normal c sigma / sqrt(n) c c This was originally a recursive routine. F-77 doesn't support c recursion. c c Written 12/28/99 -- C. R. Meyer c integer nz parameter (nz=15) real z(nz),prob(nz) real up_lim,lowlim,margin integer bkthru integer index c c ------ Standard Normal Z-values: data z/2.807,2.576,1.96,1.645,1.282,1.036,0.8416,0.6745, 1 0.5244,0.3853,0.2533,0.1257,0.06271,0.01253,0.006267/ c ------ Probabilities (percent) that populations are DIFFERENT. data prob/99.5,99.0,95.0,90.0,80.0,70.0,60.0,50.0,40.0, 1 30.0,20.0,10.0,5.0,1.0,0.5/ c if(n. gt. 0) then index = 0 10 continue bkthru = 0 if(index .lt. nz) then index = index + 1 margin = z(index)*sigma/sqrt(float(n)) up_lim = xbar + margin lowlim = xbar - margin c if((mu .gt. up_lim).or.(mu .lt.lowlim)) then level = prob(index) else bkthru = 1 c call conflm(xbar,n,mu,sigma,level,index) endif else level = 0.0 endif if(bkthru .ne. 0) goto 10 else level = 0.0 endif c return end