subroutine confls(x2sum,n,level) c ---- x2sum -- sum of the squares of the standard normal deviates. c ---- n -- number of deviates (degrees of freedom) c ---- level -- level at which one can be sure the sample of deviates c is DIFFERENT FROM the parent population. c real x2sum,level integer n c ---- For ACM routines: double precision bound,df,p,q,x integer status,which data which /1/ x = dble(x2sum) df = dble(n) c c A confidence interval on the *Standard Normal* sample varience. c Returns the "level" (percent) at which one can be confident c that the sample of 'N' measurements which produced X2sum, came c from a population DIFFERENT FROM a population with mean=0.0, c and variance=1.0 . Note that this is a test of the sample c varience only -- it does not involve or test the sample mean. c c Generally: c / Xi - mu \ 2 2 c Sum | ------- | ~ X (N); ie, Chi-Square(N) c \ sigma / c c But for our purposes, since mu=0 and sigma=1, this reduces to: c c / 2\ 2 c Sum \Xi / ~ X (N); ie, Chi-Square(N) c c Written 05/02/00 -- C. R. Meyer c Rewritten 5/16/00 to utilize Chi-Square routines from Numerical Recipes c --- CRM c if(n .gt. 0) then c ------- LEVEL is a decimal fraction here: c ------- To use binary "chi-sq.o" from copyrighted Numerical Recipes: c level = gammp(float(n)/2.0,x2sum/2.0) c ------- To use public domain ACM code (below): call cdfchi(which,p,q,x,df,status,bound) level = p c ------- LEVEL is a percent here: level = 100.0 * 2.0*abs(0.5 - level) else level = 0.0 endif c return end