Learn R Programming

rcompanion (version 2.4.30)

pairwisePermutationSymmetryMatrix: Pairwise two-sample symmetry tests with matrix output

Description

Conducts pairwise two-sample symmetry tests across groups.

Usage

pairwisePermutationSymmetryMatrix(
  formula = NULL,
  data = NULL,
  x = NULL,
  g = NULL,
  b = NULL,
  method = "fdr",
  ...
)

Value

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

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.

b

The blocking variable as a vector.

method

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

...

Additional arguments passed to coin::symmetry_test.

Author

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

Details

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

This function is a wrapper for coin::symmetry_test, passing pairwise groups to the function. It's critical to read and understand the documentation for this function to understand its use and options.

References

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

See Also

pairwisePermutationSymmetry

Examples

Run this code
data(BobBelcher)

BobBelcher$Instructor = factor( BobBelcher$Instructor, 
                                levels = c("Linda Belcher", "Louise Belcher",
                                           "Tina Belcher", "Bob Belcher",
                                           "Gene Belcher"))

library(coin)

symmetry_test(Likert ~ Instructor | Rater, data= BobBelcher,
              ytrafo   = rank_trafo,
              teststat = "quadratic")

PT = pairwisePermutationSymmetryMatrix(Likert ~ Instructor | Rater,
                                 data     = BobBelcher,
                                 ytrafo   = rank_trafo,
                                 teststat = "quadratic",
                                 method   = "fdr")
PT

PA = PT$Adjusted
library(multcompView)
multcompLetters(PA,
                compare="<",
                threshold=0.05,
                Letters=letters)     

Run the code above in your browser using DataLab