Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


votesys (version 0.1.1)

dowdall_method: Dowdall Method

Description

This is an alternative Borda method. Voters are required to assign preference scores to every candidate and one score value cannot be shared by two or more candidates. For a voter, his 1st choice gets 1, his 2nd choice gets 1/2, his 3rd choice gets 1/3... The candidate who gets the most points wins. For the function dowdall_method, ranks, rather than true values, are used. So 1, 3, 5 are ranked as 1, 2, 3, and the scores are 1/1, 1/2, 1/3.

Usage

dowdall_method(x, stop = FALSE)

Arguments

x

an object of class vote. The ballots in the object should not have duplicated values and NAs.

stop

default is FALSE, when ballots do have duplicated values or NAs, error will not be raised, but the winner will be NULL. If TRUE, an error will be raised.

Value

a list object.

  • (1) call the function call.

  • (2) method the counting method.

  • (3) candidate candidate names.

  • (4) candidate_num number of candidate.

  • (5) ballot_num number of ballots in x.

  • (6) valid_ballot_num number of ballots that are used to compute the result.

  • (7) winner the winners.

  • (8) other_info total scores.

References

  • https://en.wikipedia.org/wiki/Borda_count

Examples

Run this code
# NOT RUN {
raw <- list2ballot(string = 
    c("51: a>c>b>d", "5: c>b>d>a", "23: b>c>d>a", "21: d>c>b>a")
)
vote <- create_vote(raw, xtype = 3, candidate = c("a", "b", "c", "d"))
y1 <- borda_method(vote) # winner is c
y2 <- dowdall_method(vote) # winner is a
# }

Run the code above in your browser using DataLab