knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(consensus)

This vignette assumes you already know how to create rankings and profiles of rankings. If don't, check the previous vignettes.

t-approval

# Create the profile of rankings

The plurality function is just a wrapper of tapproval with t=1

Borda count

$$ B(a) = 5 · 3 + 3 · 2 + 6 · 1 + 0 · 0 = 27, \ B(b) = 3 · 3 + 6 · 2 + 5 · 1 + 0 · 0 = 26, \ B(c) = 6 · 3 + 0 · 2 + 0 · 1 + 8 · 0 = 18, \ B(d) = 0 · 3 + 5 · 2 + 3 · 1 + 6 · 0 = 13. $$

To replicate this using the package. First, it is necessary to create the profile of rankings:

# por <- parse_profile_of_rankings("6, c > b > a > d,
#                                   5, a > d > b > c,
#                                   3, b > a > d > c")
# borda_count(por)

WVM

The Weighted Voting Method considers the proportion of victories and defeats for each couple of candidates and it assigns to each candidate a score based on the aggregation of all the proportions of victories and ranks the candidates according to their score.



noeliarico/consensus documentation built on March 18, 2023, 12:37 p.m.