View source: R/preference_index.R
| preference_index | R Documentation |
Computes a preference index for each item in a ranking using Plackett-Luce worth parameters. For each item, the function estimates the probability of being ranked at the top or bottom of the sets in which it appears, and calculates a net winning probability as the difference between top and bottom probabilities.
preference_index(object)
object |
A |
The preference index provides a model-based summary of performance across all ranking sets. Probabilities are derived from the fitted Plackett-Luce worth parameters, normalized to sum to one.
For each item:
top_probs is the expected probability (in percent)
of being ranked first in its sets.
bottom_probs is the expected probability (in percent)
of being ranked last in its sets.
net_winning_probs is the difference
top_probs - bottom_probs, a relative preference score.
worth is the normalized worth parameter from the
Plackett-Luce model.
The output is ordered by descending net winning probability, providing a leaderboard-style summary of items.
A gosset_df (data.frame subclass) with columns:
Item identifier (name).
Number of sets with two or more ranked items in which the item appears.
Expected top probability (%).
Expected bottom probability (%).
Net winning probability (%).
Normalized worth parameter.
PlackettLuce,
as.rankings,
worth_map
library(PlackettLuce)
R = matrix(c(1, 2, 0, 0,
4, 1, 2, 3,
2, 1, 3, 0,
1, 2, 3, 0,
2, 1, 3, 0,
1, 0, 3, 2),
nrow = 6, byrow = TRUE)
colnames(R) = c("apple", "banana", "orange", "pear")
R = as.rankings(R)
preference_index(R)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.