pairwise_ordcat_test | R Documentation |
pairwise_ordcat_test
calculates pairwise comparisons for ordinal
categories between all group levels with corrections for multiple testing.
pairwise_ordcat_test(
dep_var,
indep_var,
adjmethod = "fdr",
plevel = 0.05,
symbols = letters[-1],
ref = FALSE,
cmh = TRUE
)
dep_var |
dependent variable, containing the data |
indep_var |
independent variable, should be factor |
adjmethod |
method for adjusting p values (see p.adjust) |
plevel |
threshold for significance |
symbols |
predefined as b,c, d...; provides footnotes to mark group differences, e.g. b means different from group 2 |
ref |
is the 1st subgroup the reference (like in Dunnett test) |
cmh |
Should Cochran-Mantel-Haenszel test (coin::cmh_test) be used for testing? If false, the linear-by-linear association test (coin::lbl_test) is applied. |
A list with elements "methods" (character), "p.value" (matrix), "plevel" (numeric), and "sign_colwise" (vector of length number of levels - 1)
# All pairwise comparisons
mtcars2 <- dplyr::mutate(mtcars, cyl = factor(cyl, ordered = TRUE))
pairwise_ordcat_test(dep_var = mtcars2$cyl, indep_var = mtcars2$gear)
# Only comparison against reference gear=3
pairwise_ordcat_test(dep_var = mtcars2$cyl, indep_var = mtcars2$gear, ref = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.