testAdditions {SafeVote} | R Documentation |
Test the sensitivity of a result to tactical voting.
Description
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.
Usage
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 |
tacticalBallot |
A ballot paper i.e. a vector of length |
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 |
equiet |
|
everbose |
|
Value
A matrix of experimental results, of dimension by
,
where
is the number of elections and
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))