Learn R Programming

ConsRank (version 1.0.1)

tabulaterows: Frequency distribution of a sample of rankings

Description

Given a sample of preference rankings, it compute the frequency associated to each ranking

Usage

tabulaterows(X, miss=FALSE)

Arguments

X
a N by M data matrix containing N judges judging M objects
miss
TRUE if there are missing data (partial or uncomplete rankings): default: FALSE

Value

  • Xthe unique rankings
  • Wkthe frequency associated to each ranking
  • tabfreqfrequency table

Examples

Run this code
data(Idea)
TR=tabulaterows(Idea)
FR=TR$Wk/sum(TR$Wk)
RF=cbind(TR$X,FR)
colnames(RF)=c(colnames(Idea),"fi")
#compute modal ranking
maxfreq=which(RF[,6]==max(RF[,6]))
labels(RF[maxfreq,1:5],5,colnames(Idea),labs=1)


data(APAred)
TR=tabulaterows(APAred)

data(APAFULL)
TR=tabulaterows(APAFULL)
CR1=EMCons(TR$X,TR$Wk)
CR2=FASTcons(TR$X,TR$Wk,maxiter=15)
CR3=QuickCons(TR$X,TR$Wk)

Run the code above in your browser using DataLab