# Case 1. vector example
x = c(9.5, 12, 12.3, 17)
y = 11.2
reliability(x, y)
# Case 2. PlackettLuce model
library("PlackettLuce")
R = matrix(c(1, 2, 4, 3,
4, 1, 2, 3,
2, 3, 1, 4,
4, 2, 3, 1,
2, 1, 4, 3,
1, 4, 3, 2), nrow = 6, byrow = TRUE)
colnames(R) = c("apple", "banana", "orange", "pear")
mod = PlackettLuce(R)
reliability(mod, ref = "orange")
# \donttest{
# Case 3. PlackettLuce tree
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)])
pld = cbind(G, beans[,c("maxTN", "season", "lon")])
tree = pltree(G ~ maxTN + season + lon, data = pld)
reliability(tree, ref = "Local")
# }
Run the code above in your browser using DataLab