if (FALSE) {
library(agridat)
data(desousa.potato)
dat <- desousa.potato
# Convert each trial result to vector of ranks
libs(gosset)
datrnk <- gosset::rank_tricot(dat,
# Specify the columns containing the three genotypes
items=c("gen_A", "gen_B","gen_C"),
# Specify the columns containing the rankings
input=c("yield_pos", "yield_neg"),
group = TRUE)
head(datrnk)
# Basic PlacketLuce model using only the ranks
libs(PlackettLuce)
mod0 <- PlackettLuce(datrnk)
# worth parameters (sum to 1) - probability of each item being ranked first
coef(mod0, log = FALSE)
plot(mod0, log=FALSE)
# Compare pairs of entries, quasi standard errors
# vertical line is at 1/11 (number of varieties)
mod0qv <- qvcalc::qvcalc(mod0)
# This is log scale.
plot(mod0qv, ylab = "Worth (log)", main = "desousa.potato", las=2)
# Could add weather covariates as in
# https://www.sciencedirect.com/science/article/pii/S2352711023000985?via
}
Run the code above in your browser using DataLab