Learn R Programming

rcompanion (version 1.13.2)

pairwiseOrdinalTest: Pairwise two-sample ordinal regression

Description

Performs pairwise two-sample ordinal regression across groups.

Usage

pairwiseOrdinalTest(formula = NULL, data = NULL, x = NULL, g = NULL,
  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.

method

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

...

Additional arguments passed to clm.

Value

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

Details

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

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 pairwiseOrdinalTest 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 x variable must be an ordered factor.

References

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

See Also

pairwiseOrdinalMatrix

Examples

Run this code
# NOT RUN {
data(PoohPiglet)
PoohPiglet$Likert.f = factor(PoohPiglet$Likert, ordered = TRUE)
PoohPiglet$Speaker = factor(PoohPiglet$Speaker,
                     levels = c("Pooh", "Tigger", "Piglet"))
PT = pairwiseOrdinalTest(Likert.f ~ Speaker,
                         data   = PoohPiglet,
                         method = "fdr")
PT
cldList(comparison = PT$Comparison,
        p.value    = PT$p.adjust,
        threshold  = 0.05)
 
# }

Run the code above in your browser using DataLab