Learn R Programming

gosset (version 1.5.1)

preference_index: Preference index from rankings

Description

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.

Usage

preference_index(object)

Value

A gosset_df (data.frame subclass) with columns:

item

Item identifier (name).

n

Number of appearances of the item across sets.

top

Expected top probability (%).

bottom

Expected bottom probability (%).

net_winning

Net winning probability (%).

worth

Normalized worth parameter.

Arguments

object

A rankings object (from PlackettLuce) or a matrix that can be coerced to rankings with as.rankings.

Details

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.

See Also

PlackettLuce, as.rankings, worth_map

Examples

Run this code
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)

Run the code above in your browser using DataLab