rank_tricot: Build Plackett-Luce rankings from tricot dataset

View source: R/rank_tricot.R

rank_tricotR Documentation

Build Plackett-Luce rankings from tricot dataset

Description

Create an object of class "rankings" from tricot data. Tricot stands for "triadic comparison of technology options". Is an approach to carry out large decentralized agronomic field experiments as incomplete blocks. Each incomplete block contains a set of three randomised technologies out of a larger set.

Usage

rank_tricot(
  data,
  items,
  input,
  group = FALSE,
  validate.rankings = FALSE,
  additional.rank = NULL,
  ...
)

Arguments

data

a data.frame with columns specified by items and input values

items

a character or numerical vector for indexing the column(s) containing the item names in data

input

a character or numerical vector for indexing the column(s) containing the values in data to be ranked

group

logical, if TRUE return an object of class "grouped_rankings"

validate.rankings

logical, if TRUE implements a check on ranking consistency looking for possible ties, NA or letters other than A, B, C. These entries are set to 0

additional.rank

optional, a data frame for the comparisons between tricot items and the local item

...

additional arguments passed to methods. See details

Details

full.output: logical, to return a list with a "rankings", a "grouped_rankings" and the ordered items

Value

a PlackettLuce "rankings" object, which is a matrix of dense rankings

Author(s)

Kauê de Sousa and Jacob van Etten, with ideas from Heather Turner

References

van Etten J., et al. (2016). Experimental Agriculture, 55(S1), 275–296. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1017/S0014479716000739")}

See Also

rankings, breadwheat

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

Examples


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)


gosset documentation built on April 22, 2023, 1:13 a.m.