We read with interest David C. Earnest's recent (July 2006) PS article about the pedagogical challenges surrounding the statistical computation of pseudo-random numbers (PRNGs). We write to clarify some issues regarding the testing and setting of PRNG seeds, and to direct readers' attention to a set of resources for configuring computationally accurate simulations and statistical analyses.
First, on PRNG testing, Earnest (2006, 528) writes: “This opacity is compounded by the absence of systematic testing of the random numbers generated by popular statistical software packages. For example, a recent review of statistical programs tested the accuracy of several software packages' descriptive statistics, ANOVA tests, linear and nonlinear regression algorithms, and their distributions, but not their random number generators (Altman and McDonald 2001). This is not a trivial oversight: McCullough (1999) finds nonrandomness in the generators in SPSS, SAS, and S-Plus.”
A few clarifications are in order. First, there are several popular programs available for systematically testing pseudo-random number generators. One such test suite, DIEHARD, although a bit out of date, appears to have been adopted by most statistical software vendors. Second, in Altman and McDonald 2001, cited above, we addressed the accuracy of PRNGs in three places: we provided a collection of PRNG testing resources on the web site accompanying the article (681), we included code examples that test PRNG's in our ICPSR replication file (683), and we explicitly directed those engaged in simulation to resources such as McCullough 1999 (whom Earnest also cites for this purpose), and cautioned: “Researchers who perform simulation should be wary of their random number generators” (686). Third, the problem of fixed seed selection, the main concern of Earnest's article would not be reported by any of these standard tests.
Moreover, the recommendation at the conclusion of Earnest 2006 to “manually alter the starting seed for each generation,” while sufficient for the pedagogical purposes of the article, is not generally sufficient for larger-scale research simulations, which require true random selection of seed values (see Altman, Gill, and McDonald 2003, chapters 2, 3, and 5 for detailed discussions). These clarifications notwithstanding, we agree wholeheartedly with the main thrust of Earnest 2006: statistical computation is often overlooked in such classes, and can easily trip up the unwary researcher. And we laud Earnest for drawing attention to this area.
For those readers who seek further help with configuring computationally accurate simulations and statistical analyses, we (with Jeff Gill and others) have written a book, Numerical Issues in Statistical Computing for the Social Scientist (John Wiley and Sons, 2003), that provides in-depth explanations and analyses of how the issues affect social science research. This book includes explanations of computational issues in social science terms, method- and discipline-specific case studies, and solution techniques designed to supplement existing methods courses. Book chapters, other writings, and associated software are available from our web site: www.hmdc.harvard.edu/micah_altman/numal/.
In addition, we have gathered and organized dozens of links to additional resources for accurate statistical computing on a linked “Accurate Statistical Computing” web site: www.hmdc.harvard.edu/numerical_issues/.
