set_paircomp: Pairwise comparison rankings

View source: R/rank_paircomp.R

set_paircompR Documentation

Pairwise comparison rankings

Description

Pairwise comparisons from a PlackettLuce ranking object. Ties are not taken into account, then coerced to NA's.

Usage

set_paircomp(object)

Arguments

object

an object of class "rankings" or "grouped_rankings" which is a matrix of dense rankings.

Value

an object of class "paircomp" which is a matrix of pairwise comparisons

Author(s)

Kauê de Sousa and Jacob van Etten

References

Strobl C., Wickelmaier F. & Zeileis A. (2011). Journal of Educational and Behavioral Statistics, 36(2), 135–153. doi:10.3102/1076998609359791

See Also

rankings, paircomp

Other rank functions: rank_numeric(), rank_tricot(), set_binomialfreq()

Examples

 
library("PlackettLuce")

R = matrix(c(1, 2, 0, 0,
              4, 1, 2, 3,
              2, 4, 3, 1,
              1, 2, 3, 0,
              2, 1, 1, 0,
              1, 0, 3, 2), nrow = 6, byrow = TRUE)
colnames(R) = c("apple", "banana", "orange", "pear")
R = as.rankings(R)

PC = set_paircomp(R)

#############################################

# using breadwheat data
data("breadwheat", package = "gosset")

# convert the tricot rankings from breadwheat data
# into a object of class 'rankings' from PlackettLuce
R = rank_tricot(breadwheat,
                 items = c("variety_a","variety_b","variety_c"),
                 input = c("overall_best","overall_worst"))


PC = set_paircomp(R)


gosset documentation built on May 29, 2024, 8:34 a.m.