Learn R Programming

rcompanion (version 1.0.1)

pairwisePermutationMatrix: Pairwise two-sample permutation tests with matrix output

Description

Conducts pairwise two-sample permutation tests across groups.

Usage

pairwisePermutationMatrix(x, g, method = "fdr", ...)

Arguments

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 p.adjust.
...
Additional arguments passed to independence_test.

Value

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

Details

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/rcompanion/d_06a.html

See Also

pairwisePermutationTest

Examples

Run this code
data(PoohPiglet)
PoohPiglet = PoohPiglet[order(factor(PoohPiglet$Speaker, 
                        levels=c("Pooh", "Tigger", "Piglet"))),]               
PT = pairwisePermutationMatrix(x      = PoohPiglet$Likert,
                               g      = PoohPiglet$Speaker,
                               exact  = NULL,
                               method = "fdr")$Adjusted
PT
library(multcompView)
multcompLetters(PT,
                compare="<",
                threshold=0.05,
                Letters=letters)   

Run the code above in your browser using DataLab