Wickens (1989) gives a good treatment of multiway contingency tables. His basic chapters require study, but seem essential for anyone who wishes to do serious work with frequency data. Usefully different perspectives appear in Fleiss (1981) and in Agresti (1996), who give many illustrative sets of data as well as helpful exercises.
In the other kind of contingency table, there is only a single group. Row and column variables represent two characteristics of the same subjects, as with the height-happiness example of Table 10.3. The null hypothesis says that the two subject characteristics are uncorrelated, or independent.
For two-way contingency tables, fortunately, the X2 test is exactly the same for both homogeneity and independence. With more than two variables, however, homogeneity and independence may yield different E values and hence different values of X2 for the same numerical data. This is one complication that arises with more than two variables.
I hold such a view [Fisher's] is entirely erroneous.… pardon me for comparing him with Don Quixote tilting at the windmill; he must either destroy himself, or the whole theory of probable errors.
To which Fisher replied (rather mildly for Fisher; see Fisher, 1956, pp. 2–3):
If peevish intolerance of free opinion in others is a sign of senility, it is one which he [Pearson] has developed at an early age.
Pearson's substantial contributions to the early development of statistics would shine more brightly today had he been more tolerant, for Fisher was mercilessly correct. Agresti concludes his historical survey of chi-square (p. 265) by saying:
And so, it is fitting that we end this brief survey by giving yet further credit to R. A. Fisher for his influence on the practice of modern statistical science.