testAdditions function

Test the sensitivity of a result to tactical voting.

Test the sensitivity of a result to tactical voting.

Ballots are added until a specified number of simulated elections ('arep') have been held. If a 'favoured' candidate is specified, then the ballot-box is stuffed with ballots awarding first-preference to this candidate. Alternatively, a 'tacticalBallot' may be specified. If both 'favoured' and 'tacticalBallot' are 'NULL', then a random candidate is selected as the favoured one.

testAdditions( votes, ainc = 1, arep = NULL, favoured = NULL, tacticalBallot = NULL, rankMethod = "safeRank", countMethod = "stv", countArgs = list(), exptName = NULL, equiet = FALSE, everbose = FALSE )

Arguments

  • votes: A set of ballots, as in vote_2.3.2
  • ainc: Number of ballots to be added in each step
  • arep: Maximum number of ballot-stuffed elections to run
  • favoured: Name of the candidate being "plumped". If 'NULL', a random candidate is selected from among the candidates not initially top-ranked. All other candidates are fully-ranked at random, with an identical ballot paper being stuffed multiple times. An integer value for 'favoured' is interpreted as an index into the candidate names.
  • tacticalBallot: A ballot paper i.e. a vector of length 'ncol(ballots)'. If this argument is non-'NULL', it takes precedence over 'favoured' when the ballot box is being stuffed.
  • rankMethod: "safeRank" (default), "elected", or "rank". "rank" is a total ranking of the candidates, with ties broken at random. "elected" assigns rank=1 to elected candidates, rank=2 for eliminated candidates.
  • countMethod: countMethod "stv" (default) or "condorcet"
  • countArgs: List of args to be passed to countMethod (in addition to votes)
  • exptName: stem-name of experimental units e.g. "E". If 'NULL', then a 3-character string of capital letters is chosen at random.
  • equiet: 'TRUE' to suppress all experimental output
  • everbose: 'TRUE' to produce diagnostic output from the experiment

Returns

A matrix of experimental results, of dimension nn by 2m+12m+1, where nn is the number of elections and mm is the number of candidates. The first column is named "nBallots". Other columns indicate the ranking of the eponymous candidate, and their margin over the next-lower-ranked candidate.

Examples

data(food_election) testAdditions(food_election, arep = 2, favoured = "Strawberries", countArgs = list(safety = 0))
  • Maintainer: Clark Thomborson
  • License: GPL (>= 2)
  • Last published: 2024-10-05