groupwiseCMH {rcompanion} | R Documentation |
Post-hoc tests for Cochran-Mantel-Haenszel test
Description
Conducts groupwise tests of association on a three-way contingency table.
Usage
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 |
fisher |
If |
gtest |
If |
chisq |
If |
method |
The method to use to adjust p-values. See |
correct |
The correction to apply to the G test.
See |
digits |
The number of digits for numbers in the output. |
... |
Other arguments passed to |
Details
If more than one of fisher
, gtest
, or chisq
is
set to TRUE
, only one type of test of association
will be conducted.
Value
A data frame of groups, test used, p-values, and adjusted p-values.
Author(s)
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
References
https://rcompanion.org/handbook/H_06.html
See Also
nominalSymmetryTest
,
pairwiseMcnemar
,
pairwiseNominalIndependence
,
pairwiseNominalMatrix
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)