Plackett-Luce Tree Summaries
Obtain the coefficients, variance-covariance matrix, AIC, or predictions
from a Plackett-Luce tree fitted by pltree()
.
## S3 method for class 'pltree' coef(object, node = NULL, drop = TRUE, ...) ## S3 method for class 'pltree' vcov(object, node = nodeids(object, terminal = TRUE), ...) ## S3 method for class 'pltree' AIC(object, newdata = NULL, ...) ## S3 method for class 'pltree' predict( object, newdata = NULL, type = c("itempar", "rank", "best", "node"), ... )
object |
a fitted model object of class |
node |
a vector of node ids specifying the nodes to summarise, by default the ids of the terminal nodes. |
drop |
if |
... |
additional arguments passed to
|
newdata |
an optional data frame to use instead of the
original data. For |
type |
the type of prediction to return for each group, one of:
|
AIC
computes -2 * L + 2 * p where L is the
joint likelihood of the observed rankings under the tree model and
p is the degrees of freedom used to fit the tree model.
data(beans) # fit tree based on pairwise comparisons with variety B pairB <- data.frame(Winner = ifelse(beans$var_b == "Worse", "Local", beans$variety_b), Loser = ifelse(beans$var_b == "Worse", beans$variety_b, "Local"), stringsAsFactors = FALSE, row.names = NULL) beans$G <- as.rankings(pairB, input = "orderings", index = rep(seq(nrow(beans)), 1)) mod <- pltree(G ~ ., data = beans[c("G", "maxTN")]) coef(mod, node = 3) AIC(mod) # treat first row from each year as new data newdata <- beans[!duplicated(beans$year),] ## fitted probabilities predict(mod, newdata) ## fitted log-abilities, with Local as reference predict(mod, newdata, log = TRUE, ref = "Local") ## variety ranks predict(mod, newdata, type = "rank") ## top ranked variety predict(mod, newdata, type = "best") ## node the trial belongs to predict(mod, newdata, type = "node")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.