Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fitted.PlackettLuce

Fitted Probabilities for PlackettLuce Objects


Description

Fitted probabilities for all choice/alternative combinations in the data.

Usage

## S3 method for class 'PlackettLuce'
fitted(object, aggregate = TRUE, free = TRUE, ...)

## S3 method for class 'pltree'
fitted(object, aggregate = TRUE, free = TRUE, ...)

Arguments

object

an object as returned by PlackettLuce or pltree.

aggregate

logical; if TRUE observations of the same choice from the same set of alternatives are aggregated.

free

logical; if TRUE only free choices are included, i.e. choices of one item from a set of one item are excluded.

...

further arguments, currently ignored.

Value

A list with the following components

choices

The selected item(s).

alternatives

The set of item(s) that the choice was made from.

ranking

The ranking(s) including this choice.

n

The weighted count of rankings including this choice (equal to the ranking weight if aggregate = FALSE.

fitted

The fitted probability of making this choice.

If object was a "pltree" object, the list has an additional element, node, specifying which node the ranking corresponds to.

See Also

Examples

R <- matrix(c(1, 2, 0, 0,
              4, 1, 2, 3,
              2, 1, 1, 1,
              1, 2, 3, 0,
              2, 1, 1, 0,
              1, 0, 3, 2), nrow = 6, byrow = TRUE)
colnames(R) <- c("apple", "banana", "orange", "pear")

mod <- PlackettLuce(R)
fit <- fitted(mod)
fit

PlackettLuce

Plackett-Luce Models for Rankings

v0.4.0
GPL-3
Authors
Heather Turner [aut, cre] (<https://orcid.org/0000-0002-1256-3375>), Ioannis Kosmidis [aut] (<https://orcid.org/0000-0003-1556-0302>), David Firth [aut] (<https://orcid.org/0000-0003-0302-2312>), Jacob van Etten [ctb] (<https://orcid.org/0000-0001-7554-2558>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.