View source: R/pairwiseOrdinalIndependence.r
pairwiseOrdinalIndependence | R Documentation |
Conducts pairwise tests for a 2-dimensional table,
in which one variable is ordered nominal and one variable
is non-ordered nominal.
The function relies on the coin
package.
pairwiseOrdinalIndependence(
x,
compare = "row",
scores = NULL,
method = "fdr",
digits = 3,
...
)
x |
A two-way contingency table. One dimension is ordered and one is non-ordered nominal. |
compare |
If |
scores |
Optional vector to specify the spacing of the ordered variable. |
method |
The method to adjust multiple p-values.
See |
digits |
The number of significant digits in the output. |
... |
Additional arguments, passed to |
A data frame of comparisons, p-values, and adjusted p-values.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
https://rcompanion.org/handbook/H_09.html
pairwiseNominalIndependence
### Independence test for table with one ordered variable
data(Breakfast)
require(coin)
chisq_test(Breakfast,
scores = list("Breakfast" = c(-2, -1, 0, 1, 2)))
PT = pairwiseOrdinalIndependence(Breakfast, compare = "row")
PT
cldList(comparison = PT$Comparison,
p.value = PT$p.value,
threshold = 0.05)
### Similar to Kruskal-Wallis test for Likert data
data(PoohPiglet)
XT = xtabs(~ Speaker + Likert, data = PoohPiglet)
XT
require(coin)
chisq_test(XT,
scores = list("Likert" = c(1, 2, 3, 4, 5)))
PT=pairwiseOrdinalIndependence(XT, compare = "row")
PT
cldList(comparison = PT$Comparison,
p.value = PT$p.value,
threshold = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.