








Bowker (1949) test for symmetry: Exact test






Organization:  Johannes GutenbergUniversitaet Mainz 






20100701






The package BowkerSymmetryExactTest computes a statistical test of the hypothesis that an observed r x r contingency table containing absolute frequencies is symmetric. It was proposed by Bowker, A. H. (1948). A Test for Symmetry in Contingency Tables. Journal of the American Statistical Association, 43(244), 572574. If two categorical responses are obtained for each of N subjects, in conditions A and B (for example pretreatment and posttreatment), then the Bowker procedure can be used to test the nullhypothesis that the responses in condition A do not differ from the responses in condition B. For a discussion see von Eye, A., & Spiel, C. (1996). Standard and Nonstandard LogLinear Symmetry Models for Measuring Change in Categorical Variables. The American Statistician, 50(4), 300305. The test originally proposed by Bowker computes a pvalue based on the asymptotic chisquare distribution. It is available in SAS PROC FREQ if the AGREE option is specified under TABLES. However, for tables containing cells with small expected counts, the chisquare approximation is not valid. An exact test was proposed by Krauth, J. (1973). Nichtparametrische Ansätze zur Auswertung von Verlaufskurven [Nonparametric Approaches to Analyzing Time Effect Curves]. Biometrische Zeitschrift, 15(8), 557566. It calculates the probability of observing a contingency table deviating from symmetry at least as much as the empirically observed table (under the nullhypothesis of symmetry). The exact test is also explained in Bortz, J., Lienert, G. A., & Boehnke, K. (2008). Verteilungsfreie Methoden in der Biostatistik, Available from http://dx.doi.org/10.1007/9783540747079 (Note that their example on p. 167 contains an error). The exact test (Krauth, 1973) first determines possible variants of an observed contingency matrix. Let nij be the observed frequency in the ith row and jth column of the matrix. Perfect symmetry corresponds to nij==nji for all i and j. The constraints for determining variants of the matrix are 1) that the diagonal elements (nkk) remain unchanged, and 2) that the sum of frequencies for a pair of cells (i.e., nij + nji) remains constant. Pairs with nij + nji = 0 are ignored. For all resulting matrices with asymmetry (as measured by the Bowkerstatistic) at least as extreme as for the observed matrix, a pvalue under the nullhypothesis of symmetry is computed (for details see Krauth, 1973). The sum of these pvalues gives the exact pvalue of the test. This Mathematicapackage computes the approximate and the exact pvalue of the Bowkertest. Functions: pBowkerExact[observedContingencyTable] returns the exact pvalue for a square contingency table and also prints the results of the approximate test. bowkerStat[squareMatrix] returns the test statistic for a specific square matrix. probBowker[squareMatrix] returns the probability of observing a specific square matrix under the nullhypothesis of symmetry. Created July, 01, 2010, Dr. Daniel OberfeldTwistel, Department of Psychology, Johannes GutenbergUniversität Mainz, Germany. Email: oberfeld@unimainz.de












symmetry, hypothesis test, exact test, contingency tables, categorical data, paired samples, repeated measurements, dependent observations, statistics, applied mathematics, psychology, social sciences, agriculture, medicine






 BowkerSymmetryExactTest.m (6.7 KB)  Mathematica Package   bowkerExactDemo.m (1.4 KB)  Mathematica Package 







   
 
