Wolfram Library Archive


All Collections Articles Books Conference Proceedings
Courseware Demos MathSource Technical Notes
Title Downloads

Bowker (1949) test for symmetry: Exact test
Author

Daniel Oberfeld-Twistel
Organization: Johannes Gutenberg-Universitaet Mainz
Department: Psychology
Revision date

2010-07-01
Description

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), 572-574.

If two categorical responses are obtained for each of N subjects, in conditions A and B (for example pre-treatment and post-treatment), then the Bowker procedure can be used to test the null-hypothesis 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 Log-Linear Symmetry Models for Measuring Change in Categorical Variables. The American Statistician, 50(4), 300-305.

The test originally proposed by Bowker computes a p-value based on the asymptotic chi-square 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 chi-square 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), 557-566.

It calculates the probability of observing a contingency table deviating from symmetry at least as much as the empirically observed table (under the null-hypothesis 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/978-3-540-74707-9 (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 Bowker-statistic) at least as extreme as for the observed matrix, a p-value under the null-hypothesis of symmetry is computed (for details see Krauth, 1973).

The sum of these p-values gives the exact p-value of the test.

This Mathematica-package computes the approximate and the exact p-value of the Bowker-test.

Functions:

pBowkerExact[observedContingencyTable] returns the exact p-value 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 null-hypothesis of symmetry.

Created July, 01, 2010, Dr. Daniel Oberfeld-Twistel, Department of Psychology, Johannes Gutenberg-Universität Mainz, Germany. Email: oberfeld@uni-mainz.de
Subjects

*Applied Mathematics
*Mathematica Technology > Programming > Packages and Contexts
*Mathematics > Probability and Statistics
*Science > Biology
*Science > Hydrology
*Science > Medicine
*Social Science
Keywords

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

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