Learn R Programming

rcompanion (version 1.13.2)

pairwiseRobustMatrix: Pairwise two-sample robust tests with matrix output

Description

Performs pairwise two-sample robust tests across groups with matrix output.

Usage

pairwiseRobustMatrix(formula = NULL, data = NULL, x = NULL, g = NULL,
  est = "mom", nboot = 599, 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.

est

Estimate used for group comparisons. "onestep", "mom", "median", or "mean". See pb2gen for details.

nboot

The number of bootstrap samples.

method

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

...

Additional arguments passed to pb2gen.

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.

The WRS2 package provides functions for robust estimation and hypothesis testing. This function invokes the pb2gen to make pairwise comparisons among groups.

The pairwiseRobustMatrix function can be used as a post-hoc method following an omnibus one-way anova with robust estimation.

References

http://rcompanion.org/rcompanion/d_08a.html

See Also

pairwiseRobustTest

Examples

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

# }

Run the code above in your browser using DataLab