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

make_complete

Completion of partial rankings/orderings


Description

Return complete rankings/orderings from partial sequences relying on a random generation of the missing positions/items.

Usage

make_complete(data, format_input, nranked = NULL, probitems = rep(1,
  ncol(data)))

Arguments

data

Numeric NxK data matrix of partial sequences to be completed.

format_input

Character string indicating the format of the data input, namely "ordering" or "ranking".

nranked

Optional numeric vector of length N with the number of items ranked by each sample unit.

probitems

Numeric vector with the K item-specific probabilities to be employed for the random generation of the missing positions/items (see 'Details'). Default is equal probabilities.

Details

The completion of the partial top rankings/orderings is performed according to the Plackett-Luce scheme, that is, with a sampling without replacement of the not-ranked items by using the positive values in the probitems argument as support parameters (normalization is not necessary).

Value

A list of two named objects:

completedata

Numeric NxK data matrix of complete sequences with the same format of the input data.

nranked

Numeric vector of length N with the number of items ranked by each sample unit of the input data.

Author(s)

Cristina Mollica and Luca Tardella

Examples

## Completion based on the top item frequencies
data(d_dublinwest)
head(d_dublinwest)
top_item_freq <- rank_summaries(data=d_dublinwest, format_input="ordering", mean_rank=FALSE, 
                                pc=FALSE)$marginals["Rank_1",]

d_dublinwest_compl <- make_complete(data=d_dublinwest, format_input="ordering", 
                                    probitems=top_item_freq)
head(d_dublinwest_compl$completedata)

PLMIX

Bayesian Analysis of Finite Mixtures of Plackett-Luce Models for Partial Rankings/Orderings

v2.1.1
GPL (>= 2)
Authors
Cristina Mollica [aut, cre], Luca Tardella [aut]
Initial release
2019-09-04

We don't support your browser anymore

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