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.
rank_tricot(
data,
items,
input,
group = FALSE,
validate.rankings = FALSE,
additional.rank = NULL,
...
)a data.frame with columns specified by items and input values
a character or numerical vector for indexing the column(s)
containing the item names in data
a character or numerical vector for indexing the column(s)
containing the values in data to be ranked
logical, if TRUE return an object of class "grouped_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
optional, a data frame for the comparisons between tricot items and the local item
additional arguments passed to methods. See details
a PlackettLuce "rankings" object, which is a matrix of dense rankings
full.output: logical, to return a list with a "rankings", a "grouped_rankings" and the ordered items
van Etten J., et al. (2016). Experimental Agriculture, 55(S1), 275–296. doi:10.1017/S0014479716000739
Other rank functions:
rank_numeric(),
rank_tricot2(),
set_binomialfreq(),
set_paircomp()
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)
#> Warning: Ties, NA's or letters different than A, B, C, were identified in rows 3, 5
#> Use validate.rankings = TRUE to ignore these entries
# 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)
#> Warning: Ties, NA's or letters different than A, B, C, were identified in rows 3, 5
coef(PlackettLuce(R1))
#> INTA Rojo INTA Ferroso INTA Centro Sur INTA Sequia SJC 730-79
#> 0.00000000 0.21875860 0.80579070 0.06668594 -0.32006474
#> INTA Matagalpa PM2 Don Rey BRT 103-182 ALS 0532-6 tie2
#> 0.21875860 2.22747576 0.21875860 -1.19922382 -2.03675734
#> tie3
#> 0.34366213
coef(PlackettLuce(R2))
#> INTA Rojo INTA Ferroso INTA Centro Sur INTA Sequia SJC 730-79
#> 0.00000000 -0.04890145 0.56963881 0.31607554 -0.80520905
#> INTA Matagalpa PM2 Don Rey BRT 103-182 ALS 0532-6
#> -0.04890145 0.70740624 -0.04890145 -1.16010931
############################################################
# 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)])
#> Warning: Ties, NA's or letters different than A, B, C, were identified in rows 3, 5
#> Use validate.rankings = TRUE to ignore these entries
#> Error in `[.data.frame`(beans, c(6:8)): undefined columns selected
head(G)
#> Error: object 'G' not found