Exact and McNemar symmetry tests for paired contingency tables
Exact and McNemar symmetry tests for paired contingency tables
Conducts an omnibus symmetry test for a paired contingency table and then post-hoc pairwise tests. This is similar to McNemar and McNemar-Bowker tests in use.
x: A two-way contingency table. It must be square. It can have two or more levels for each dimension.
method: The method to adjust multiple p-values. See stats::p.adjust.
digits: The number of significant digits in the output.
exact: If TRUE, uses the binom.test function. If FALSE, uses the mcnemar.test function.
...: Additional arguments
Returns
A list containing: a data frame of results of the global test; a data frame of results of the pairwise results; and a data frame mentioning the p-value adjustment method.
Details
The omnibus McNemar test may fail when there are zeros in critical cells.
Currently, the exact=TRUE with a table greater than 2 x 2 will not produce an omnibus test result.
Examples
### 2 x 2 repeated matrix exampledata(AndersonRainBarrel)nominalSymmetryTest(AndersonRainBarrel)### 3 x 3 repeated matrix exampledata(AndersonRainGarden)nominalSymmetryTest(AndersonRainGarden, exact =FALSE)