rcompanion (version 2.2.2)

pairwisePermutationMatrix: Pairwise two-sample permutation tests with matrix output

Description

Conducts pairwise two-sample permutation tests across groups.

Usage

pairwisePermutationMatrix(formula = NULL, data = NULL, x = NULL,
  g = NULL, 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.

method

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

...

Additional arguments passed to coin::independence_test.

Value

A list consisting of: A matrix of p-values; the p-value adjustment method; a matrix of adjusted p-values.

Details

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

Permutation tests are non-parametric tests that do not assume normally-distributed errors. See http://rcompanion.org/rcompanion/d_06a.html for futher discussion of this test.

The pairwisePermutationTest function can be used as a post-hoc method following an omnibus permutation test analogous to a one-way analysis of variance. The matrix output can be converted to a compact letter display.

References

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

See Also

pairwisePermutationTest

Examples

Run this code
# NOT RUN {
data(PoohPiglet)
PoohPiglet$Speaker = factor(PoohPiglet$Speaker,
                     levels = c("Pooh", "Tigger", "Piglet"))            
PT = pairwisePermutationMatrix(Likert ~ Speaker,
                               data   = PoohPiglet,
                               method = "fdr")
PT
PT = PT$Adjusted
library(multcompView)
multcompLetters(PT,
                compare="<",
                threshold=0.05,
                Letters=letters)   

# }

Run the code above in your browser using DataLab