kemenyd: Kemeny distance

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

View source: R/ALL.r View source: R/kemenyd.R

Description

Compute the Kemeny distance of a data matrix containing preference rankings, or compute the kemeny distance between two (matrices containing) rankings.

Usage

1
kemenyd(X, Y = NULL)

Arguments

X

A N by M data matrix, in which there are N judges and M objects to be judged. Each row is a ranking of the objects which are represented by the columns. If there is only X as input, the output is a square distance matrix

Y

A row vector, or a n by M data matrix in which there are n judges and the same M objects as X to be judged.

Value

If there is only X as input, d = square distance matrix. If there is also Y as input, d = matrix with N rows and n columns.

Author(s)

Antonio D'Ambrosio [email protected]

References

Kemeny, J. G., & Snell, L. J. (1962). Preference ranking: an axiomatic approach. Mathematical models in the social sciences, 9-23.

See Also

Tau_X TauX rank correlation coefficient

Examples

1
2
3
4
5
data(Idea)
RevIdea=6-Idea ##as 5 means "most associated", it is necessary compute the reverse 
#ranking of each rankings to have rank 1 = "most associated" and rank 5 = "least associated"
KD=kemenyd(RevIdea)
KD2=kemenyd(RevIdea[1:10,],RevIdea[55,])

ConsRank documentation built on May 30, 2017, 3:05 a.m.