AS205 is Applied Statistics Algorithm 205. This algorithm generates contingency tables, which are M by N tables of nonnegative integers with specified row and column sums.
For example, for the row sum vector (1,3) and column sum vector (1,1,2), there are "essentially" only the two solutions:
0 0 1
1 1 1
and
0 1 0
1 0 2
We could generate another solution by permuting the first two columns
of the second solution, but AS205 doesn't consider that a
distinct solution.
Note that it is possible to specify a problem for which there are no corresponding contingency tables at all. The simplest way is if the row and column sum vectors don't themselves sum up to the same value. But there is also a "technical" condition that the two vectors have to satisfy in order for a solution to exist.
The routine IMAT_01_ROWCOLSUM in SUBSET can compute a contingency table whose entries are only 0's and 1's.
Reference:
Ian Saunders,
Algorithm AS205,
Enumeration of R x C Tables with Repeated Row Totals,
Applied Statistics,
Volume 33, Number 3, pages 340-352, 1984.
Files you may copy include:
The list of routines includes:
Return to the biomedical software page.