* The DIEHARD tests of random number generators by George Marsaglia * can be found at * * http://stat.fsu.edu/pub/diehard/ * * DIEHARD requires 3 million 32-bit integers generated by the random * number generator. * Updated for Stata 13 on 2013-06-17 clear all set obs 3000000 * reset the seed to the default set seed 123456789 * We use -long- storage type to get 32-bit integers * * In * * McCullough, Brian D. 1999. "Assessing the Reliability of Statistical * Software: Part II", The American Statistician 53(2): 149-159 * * it indicates (on page 156) that the integers are to be calculated as * * INT(-2147483649 + 4294967297*RAN) * gen long x = int(-2147483649 + 4294967297*runiform()) * The DIEHARD programs require a certain format for the data. It wants * the numbers 10 on a line in hexadecimal representation in an ascii file. * There is then a DIEHARD utility program that takes this kind of file and * produces another binary file that DIEHARD actually uses. McCullough * (see reference above) suggests just writing the numbers to an ascii file * and then writing a simple program to translate that into the format that * the DIEHARD utility program desires. outfile x using randnumb.raw * The C program chnghex.c will take a file like randnumb.raw produced * above and create the ascii hex file that the DIEHARD utility program * asc2bin desires. exit