Learn R Programming

rcompanion (version 1.0.1)

pairwiseSignTest: Pairwise sign tests for paired data

Description

Conducts pairwise sign tests across groups for paired data.

Usage

pairwiseSignTest(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 SIGN.test.

Value

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

Details

The two sample paired sign test compares medians among two groups with paired data. See http://rcompanion.org/handbook/F_07.html for futher discussion of this test.

The pairwiseSignTest function can be used as a post-hoc method following an omnibus Friedman test. The function assumes that the data frame is already ordered by the blocking variable, so that the first observation of Group 1 is paired with the first observation of Group 2, and so on.

References

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

See Also

pairwiseSignMatrix

Examples

Run this code
data(BobBelcher)
BobBelcher = BobBelcher[order(BobBelcher$Instructor, BobBelcher$Rater),]
friedman.test(Likert ~ Instructor | Rater,
              data = BobBelcher)
BobBelcher = BobBelcher[order(factor(BobBelcher$Instructor, 
                        levels=c("Linda Belcher", "Louise Belcher",
                                 "Tina Belcher", "Bob Belcher",
                                 "Gene Belcher"))),] 
pairwiseSignTest(x      = BobBelcher$Likert,
                 g      = BobBelcher$Instructor,
                 method = "fdr")

Run the code above in your browser using DataLab