PlackettLuce (version 0.2-9)

fitted.PlackettLuce: Fitted Probabilities for PlackettLuce Objects

Description

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

Usage

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

# S3 method for 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

choices

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab