is.top_ordering: Top-ordering datasets

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/PLMIXfunctions.R

Description

Check the consistency of partial ordering data with a top-ordering dataset.

Usage

1

Arguments

data

An object containing the partial orderings whose consistency with a top-ordering dataset has to be tested. The following classes are admissible for data: numeric matrix, data.frame, RandData from the rankdist package and rankings from the PlackettLuce package.

...

Further arguments passed to or from other methods (not used).

Details

The argument data requires the partial sequences expressed in ordering format. When the value of is.top-ordering is FALSE, the membership function returns also a message with the conditions that are not met for the data to be a top-ordering dataset. NA's in the input data are tacitly converted into zero entries.

Value

Logical: TRUE if the data argument is consistent with a top-ordering dataset (with a possible warning message if the supplied data need a further treatment with the coercion function as.top_ordering before being processed with the core functions of PLMIX) and FALSE otherwise.

Author(s)

Cristina Mollica and Luca Tardella

References

Turner, H., Kormidis, I. and Firth, D. (2018). PlackettLuce: Plackett-Luce Models for Rankings. R package version 0.2-3. https://CRAN.R-project.org/package=PlackettLuce

Qian, Z. (2018). rankdist: Distance Based Ranking Models. R package version 1.1.3. https://CRAN.R-project.org/package=rankdist

See Also

rankings and rankings

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## A toy example of data matrix not satisfying the conditions to be a top-ordering dataset
toy_data=rbind(1:5,
c(0,4,3,2,1),
c(4,3.4,2,1,5),
c(2,3,0,0,NA),
c(4,4,3,2,5),
c(3,5,4,2,6),
c(2,-3,1,4,5),
c(2,0,1,4,5),
c(2,3,1,1,1),
c(2,3,0,4,0))

is.top_ordering(data=toy_data) 

## A dataset from the StatRank package satisfying the conditions to be a top-ordering dataset
library(StatRank) 
data(Data.Election9)
is.top_ordering(data=Data.Election9)

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