Statistics and Computing

, Volume 8, Issue 4, pp 391–399 | Cite as

Exact tests for two-way symmetriccontingency tables



A two-way contingency table in which both variables have the same categories is termed a symmetric table. In many applications, because of the social processes involved, most of the observations lie on the main diagonal and the off-diagonal counts are small. For these tables, the model of independence is implausible and interest is then focussed on the off-diagonal cells and the models of quasi-independence and quasi-symmetry. For ordinal variables, a linear-by-linear association model can be used to model the interaction structure. For sparse tables, large-sample goodness-of-fit tests are often unreliable and one should use an exact test. In this paper, we review exact tests and the computing problems involved. We propose new recursive algorithms for exact goodness-of-fit tests of quasi-independence, quasi-symmetry, linear-by-linear association and some related models. We propose that all computations be carried out using symbolic computation and rational arithmetic in order to calculate the exact p-values accurately and describe how we implemented our proposals. Two examples are presented.

Exact conditional tests inter-observer agreement linear-by-linear association quasi-independence quasi-symmetry square tables uniform association 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Abelson, H., Sussman, G. (1985) Structure and Interpretation of Computer Programs. MIT Press, Cambridge, MA.Google Scholar
  2. Agresti, A. (1988) A model for agreement between ratings on an ordinal scale. Biometrics, 44, 539–548.Google Scholar
  3. Agresti, A. (1990) Categorical Data Analysis. Wiley, New York.Google Scholar
  4. Agresti, A. (1992) A survey of exact inference for contingency tables (with discussion). Statistical Science, 7, 131–177.Google Scholar
  5. Agresti, A., Wackerly, D., Boyett, J. M. (1979) Exact conditional tests for cross-classifications: approximation of attained significance levels. Psychometrika, 44, 75–83.Google Scholar
  6. Bishop, Y. M. M., Fienberg, S. E. and Holland, P. W. (1975) Discrete Multivariate Analysis: Theory and Practice. MIT Press, Cambridge, MA.Google Scholar
  7. Boulton, D. M., and Wallace, C. A. (1973) Occupancy of a rectangular array. Computer Journal, 16, 57–63.Google Scholar
  8. De Roure, D. C., Michaelidies, D. (1994) A distributed LISP-STAT environment, in Proceedings of COMPSTAT 1994, Dutter, R. and Grossman, W. (eds), Physica-Verlag, Heidelberg, pp. 371–376.Google Scholar
  9. Forster, J. J., McDonald, J. W., Smith, P. W. F. (1996) Monte Carlo exact conditional tests for log-linear and logistic models. Journal of the Royal Statistical Society, Series B, 58, 445–453.Google Scholar
  10. Freeman, G. H., Halton, J. H. (1951) Note on an exact treatment of contingency, goodness of fit and other problems of significance. Biometrika, 38, 141–149.Google Scholar
  11. Holmquist, N. S., McMahon, C. A., Williams, O. D. (1967) Variability in classification of carcinoma in situ of the uterine cervix. Archives of Pathology, 84, 334–345.Google Scholar
  12. Hout, M., Duncan, O. D., Sobel, M. E. (1987) Association and heterogeneity: structural models of similarities and differences, in Sociological Methodology 1987, Clogg, C. C. (ed.), American Sociological Association, Washington DC, pp. 145–184.Google Scholar
  13. Kim, D., Agresti, A. (1995) Improved exact inference about conditional association in three-way contingency tables. Journal of the American Statistical Association, 90, 632–639.Google Scholar
  14. Feinberg, S. E., Meyer, M. M. (1983) Iterative proportional fitting, in Encyclopedia of Statistical Sciences, Vol. 4, Kotz, S. (ed.), Wiley, New York, pp. 275–279.Google Scholar
  15. Lawal, H. B., Upton, G. J. G. (1995) An algorithm for fitting models to N × N contingency tables having ordered categories. Communications in Statistics-Simulation, 24, 793–805.Google Scholar
  16. McDonald, J. W., Smith, P. W. F. (1995) Exact conditional tests of quasi-independence for triangular contingency tables: estimating attained significance levels. Applied Statistics, 44, 143–151.Google Scholar
  17. Mehta, C. R. (1994) The exact analysis of contingency tables in medical research. Statistical Methods in Medical Research, 3, 135–156.Google Scholar
  18. Michaelides, D. T. (1997) Exact Tests via Complete Enumeration: A Distributed Computing Approach. Ph.D. thesis. Department of Social Statistics, University of Southampton.Google Scholar
  19. Senchaudhuri, P., Mehta, C. R., Patel, N. R. (1995) Estimating exact p-values by the method of control variates, or Monte Carlo Rescue. Journal of the American Statistical Association, 90, 640–648.Google Scholar
  20. Serpette, B., Vuillemin, J., Hervé, J. (1989) BigNum: a portable and efficient package for arbitrary-precision arithmetic. Research Report 2, Digital Equipment Corporation Paris Research Laboratory. Available at Scholar
  21. Smith, P. W. F., McDonald, J. W. (1995) Exact conditional tests for incomplete contingency tables: estimating attained significance levels. Statistics and Computing, 5, 253–256.Google Scholar
  22. Smith, P. W. F., Forster, J. J., McDonald, J. W. (1996a) Monte Carlo exact tests for square contingency tables. Journal of the Royal Statistical Society, Series A, 159, 309–321.Google Scholar
  23. Smith, P. W. F., McDonald, J. W., Forster, J. J., Berrington, A. M. (1996b) Monte Carlo exact methods used for analysing interethnic unions in Great Britain. Applied Statistics, 45, 191–202.Google Scholar
  24. Thisted, R. A. (1988) Elements of Statistical Computing, Chapman and Hall, New York.Google Scholar
  25. Verbeek, A., Kroonenberg, P. M. (1985) A survey of algorithms for exact distributions of test statistics in r × c contingency tables with fixed margins. Computational Statistics & Data Analysis, 3, 159–185.Google Scholar
  26. Wu, T. (1993) An accurate computation of the hypergeometric distribution function. ACM Transactions on Mathematical Software, 19, 33–43.Google Scholar

Copyright information

© Kluwer Academic Publishers 1998

Authors and Affiliations

    • 1
    • 2
    • 1
  1. 1.Department of Social StatisticsUniversity of SouthamptonSouthamptonUK
  2. 2.Department of Electronics and Computer ScienceUniversity of SouthamptonSouthamptonUK

Personalised recommendations