pairwisePermutationSymmetry: Pairwise two-sample symmetry tests

View source: R/pairwisePermutationSymmetry.r

pairwisePermutationSymmetryR Documentation

Pairwise two-sample symmetry tests

Description

Conducts pairwise two-sample symmetry tests across groups.

Usage

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

Arguments

formula

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

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.

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.

Value

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

Note

The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The first variable on the right side is used for the grouping variable. The second variable on the right side is used for the blocking variable.

Author(s)

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

References

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

See Also

pairwisePermutationSymmetryMatrix

Examples

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 = pairwisePermutationSymmetry(Likert ~ Instructor | Rater,
                                 data     = BobBelcher,
                                 ytrafo   = rank_trafo,
                                 teststat = "quadratic",
                                 method   = "fdr")
PT

cldList(comparison = PT$Comparison,
        p.value    = PT$p.adjust,
       threshold  = 0.05)


rcompanion documentation built on May 29, 2024, 8:42 a.m.