statsmodels.stats.contingency_tables.Table2x2.symmetry¶
-
Table2x2.
symmetry
(method='bowker')¶ Test for symmetry of a joint distribution.
This procedure tests the null hypothesis that the joint distribution is symmetric around the main diagonal, that is
\[\]p_{i, j} = p_{j, i} for all i, j
Returns: - A bunch with attributes
- statistic (float) – chisquare test statistic
- p-value (float) – p-value of the test statistic based on chisquare distribution
- df (int) – degrees of freedom of the chisquare distribution
Notes
The implementation is based on the SAS documentation. R includes it in mcnemar.test if the table is not 2 by 2. However a more direct generalization of the McNemar test to larger tables is provided by the homogeneity test (TableSymmetry.homogeneity).
The p-value is based on the chi-square distribution which requires that the sample size is not very small to be a good approximation of the true distribution. For 2x2 contingency tables the exact distribution can be obtained with mcnemar
See also