groupwiseCMH function

Post-hoc tests for Cochran-Mantel-Haenszel test

Post-hoc tests for Cochran-Mantel-Haenszel test

Conducts groupwise tests of association on a three-way contingency table.

groupwiseCMH( x, group = 3, fisher = TRUE, gtest = FALSE, chisq = FALSE, method = "fdr", correct = "none", digits = 3, ... )

Arguments

  • x: A three-way contingency table.
  • group: The dimension of the table to use as the grouping variable. Will be 1, 2, or 3.
  • fisher: If TRUE, conducts Fisher exact test.
  • gtest: If TRUE, conducts G test of association.
  • chisq: If TRUE, conducts Chi-square test of association.
  • method: The method to use to adjust p-values. See ?p.adjust.
  • correct: The correction to apply to the G test. See GTest.
  • digits: The number of digits for numbers in the output.
  • ...: Other arguments passed to chisq.test or GTest.

Returns

A data frame of groups, test used, p-values, and adjusted p-values.

Details

If more than one of fisher, gtest, or chisq is set to TRUE, only one type of test of association will be conducted.

Examples

### Post-hoc for Cochran-Mantel-Haenszel test data(AndersonBias) Table = xtabs(Count ~ Gender + Result + County, data=AndersonBias) ftable(Table) mantelhaen.test(Table) groupwiseCMH(Table, group = 3, fisher = TRUE, gtest = FALSE, chisq = FALSE, method = "fdr", correct = "none", digits = 3)

References

https://rcompanion.org/handbook/H_06.html

See Also

nominalSymmetryTest, pairwiseMcnemar, pairwiseNominalIndependence, pairwiseNominalMatrix

Author(s)

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu