Learn R Programming

rcompanion (version 1.0.1)

pairwiseOrdinalMatrix: Pairwise two-sample ordinal regression with matrix output

Description

Performs pairwise two-sample ordinal regression across groups.

Usage

pairwiseOrdinalMatrix(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 clm.

Value

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

Details

Ordinal regression is analogous to general linear regression or generalized linear regression for cases where the dependent variable is an ordinal variable. The ordinal package provides a flexible and powerful implementation of ordinal regression. The pairwiseOrdinalMatrix function can be used as a post-hoc method following an omnibus ordinal regession whose form is analogous to a one-way analysis of variance. The matrix output can be converted to a compact letter display. The x variable must be an ordered factor.

References

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

See Also

pairwiseOrdinalTest

Examples

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

Run the code above in your browser using DataLab