make_partial: Censoring of complete rankings/orderings

Description Usage Arguments Details Value Author(s) Examples

View source: R/PLMIXfunctions.R

Description

Return partial top rankings/orderings from complete sequences obtained either with user-specified censoring patterns or with a random truncation.

Usage

1
2
make_partial(data, format_input, nranked = NULL, probcens = rep(1,
  ncol(data) - 1))

Arguments

data

Numeric NxK data matrix of complete sequences to be censored.

format_input

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

nranked

Numeric vector of length N with the desired number of items ranked by each sample unit after censoring. If not supplied (NULL), the censoring patterns are randomly generated according to the probabilities in the probcens argument.

probcens

Numeric vector of length (K-1) with the probability of each censoring pattern to be employed for the random truncation of the complete sequences (normalization is not necessary). It works only if nranked argument is NULL (see 'Details'). Default is equal probabilities.

Details

The censoring of the complete sequences can be performed in: (i) a deterministic way, by specifying the number of top positions to be retained for each sample unit in the nranked argument; (ii) a random way, by sequentially specifying the probabilities of the top-1, top-2, ..., top-(K-1) censoring patterns in the probcens argument. Recall that a top-(K-1) sequence corresponds to a complete ordering/ranking.

Value

A list of two named objects:

partialdata

Numeric NxK data matrix of partial (censored) sequences with the same format of the input data and missing positions/items denoted with zero entries.

nranked

Numeric vector of length N with the number of items ranked by each sample unit after censoring.

Author(s)

Cristina Mollica and Luca Tardella

Examples

1
2
3
4
5
6
7
8
data(d_german)
head(d_german)
d_german_cens <- make_partial(data=d_german, format_input="ordering", 
                              probcens=c(0.3, 0.3, 0.4))  
head(d_german_cens$partialdata)

## Check consistency with the nominal censoring probabilities
round(prop.table(table(d_german_cens$nranked)), 2)

PLMIX documentation built on Sept. 4, 2019, 5:03 p.m.