Learn R Programming

rankrate (version 1.2.1)

kendall: Calculate the Kendall's tau between rankings

Description

This function calculates Kendall's tau distance between ranking(s) and a central permutation, pi0

Usage

kendall(rankings, pi0)

Value

A vector of the Kendall's tau distance between each ranking in rankings and pi0.

Arguments

rankings

A matrix of rankings, potentially with attribute "assignments" to signify separate reviewer assignments. One ranking per row.

pi0

A vector specifying the consensus (modal probability) ranking.

Examples

Run this code
ranking1 <- c(2,1,3)
ranking2 <- matrix(c(2,1,3,1,2,3),byrow=TRUE,nrow=2)
ranking3 <- matrix(c(1,2,3,4,2,4,NA,NA),byrow=TRUE,nrow=2)
attr(ranking3,"assignments") <- matrix(c(TRUE,TRUE,TRUE,TRUE,
  FALSE,TRUE,FALSE,TRUE),byrow=TRUE,nrow=2)
kendall(ranking1,c(1,2,3))
kendall(ranking2,c(1,2,3))
kendall(ranking3,c(1,2,3,4))

Run the code above in your browser using DataLab