rcompanion (version 2.2.2)

pairwiseMedianTest: Pairwise Mood's median tests

Description

Conducts pairwise Mood's median tests across groups.

Usage

pairwiseMedianTest(formula = NULL, data = NULL, x = NULL, g = NULL,
  digits = 4, method = "fdr", ...)

Arguments

formula

A formula indicating the measurement variable and the grouping variable. e.g. y ~ group.

data

The data frame to use.

x

The response variable as a vector.

g

The grouping variable as a vector.

digits

The number of significant digits to round output.

method

The p-value adjustment method to use for multiple tests. See stats::p.adjust.

...

Additional arguments passed to codecoin::median_test.

Value

A dataframe of the groups being compared, the p-values, and the adjusted p-values.

Details

The input should include either formula and data; or x, and g.

Mood's median test compares medians among two or more groups. See http://rcompanion.org/handbook/F_09.html for futher discussion of this test.

The pairwiseMedianTest function can be used as a post-hoc method following an omnibus Mood's median test.

References

http://rcompanion.org/handbook/F_09.html

See Also

pairwiseMedianMatrix

Examples

Run this code
# NOT RUN {
data(PoohPiglet)
PoohPiglet$Speaker = factor(PoohPiglet$Speaker,
                     levels = c("Pooh", "Tigger", "Piglet"))
PT = pairwiseMedianTest(Likert ~ Speaker,
                        data   = PoohPiglet,
                        exact  = NULL,
                        method = "fdr")
PT                         
cldList(comparison = PT$Comparison,
        p.value    = PT$p.adjust,
        threshold  = 0.05)                         

# }

Run the code above in your browser using DataCamp Workspace