library("PlackettLuce")
data("beans", package = "PlackettLuce")
# Using a subset of the bean data
beans = beans[1:5, 1:5]
beans[1, 1] = NA
beans[3, 4:5] = NA
beans[5, 5] = "Tie"
# The default approach do not validate rankings
# accepting any entry used in the argument input
R1 = rank_tricot(beans,
items = c(1:3),
input = c(4:5),
group = FALSE)
# Using validate.rankings = TRUE, the rankings
# are only considered for those entries without
# NAs, Ties and with any of the letters A, B, C
# this do not affect the lenght of the final ranking
R2 = rank_tricot(beans,
items = c(1:3),
input = c(4:5),
validate.rankings = TRUE,
group = FALSE)
coef(PlackettLuce(R1))
coef(PlackettLuce(R2))
############################################################
# pass the comparison with local item as an additional rankings, then
# each of the 3 varieties are compared separately with the local item
# and return an object of class grouped_rankings
data("beans", package = "PlackettLuce")
G = rank_tricot(data = beans,
items = c(1:3),
input = c(4:5),
group = TRUE,
additional.rank = beans[c(6:8)])
head(G)
Run the code above in your browser using DataLab