ASA159 is Applied Statistics Algorithm 159. It accepts a table shape, and the row and column sums. It then randomly generates a table with the given shape and sums.
Files you may copy include:
ASA159.F90, the source code.
ASA159_PRB.F90, a sample problem.
ASA159_PRB.OUT, sample problem output.
The list of routines includes:
RCONT2 constructs a random 2 way contingency table with given sums.
IVEC_PRINT prints an integer vector.
IMAT_PRINT prints an integer matrix.