/* The Monobit Test[of Old FIPS 140-1] for 01 random sequence (full version required) */ /* Notice: This program does not work on Light version of GAUSS. */ new; cls; x=rndu(20000,1); x=(x.>0.5); /* x=rev(x); if you need the reverse order of it. */ call monobit(x); proc monobit(x); local count; if ismiss(x); errorlog "Warning: missing data found."; x=packr(x); endif; if rows(x)<20000; errorlog "Error: This test requires the sample of at least 20000."; retp("."); endif; x=x[1:20000]; /* Use the first 20000. */ count=sumc(x); print "The Monobit Test:"; print/lz "# of 1's=" count;; if count>9654 and count<10346; print "Pass"; else; print "Fail"; endif; retp(count); endp;