testDeletions: Assess the safety of a preliminary result for an election

View source: R/saferank.R

testDeletionsR Documentation

Assess the safety of a preliminary result for an election

Description

Ballots are deleted at random from the ballot-box, with election results computed once per 'dinc' ballot-deletions. The experiment terminates after a specified number of ballots have been deleted, or a specified number of ballot-counts have occurred. Note: these ballot-counts are correlated. Use testFraction() to experiment with independently-drawn samples from the ballot-box.

Usage

testDeletions(
  votes,
  countMethod = "stv",
  countArgs = list(),
  dstart = NULL,
  dinc = NULL,
  dlimit = NULL,
  drep = NULL,
  rankMethod = "safeRank",
  exptName = NULL,
  equiet = FALSE,
  everbose = FALSE
)

Arguments

votes

A set of ballots, as in vote_2.3.2

countMethod

"stv" (default) or "condorcet"

countArgs

List of args to be passed to 'countMethod' (in addition to 'votes')

dstart

Number of ballots in the first ballot-count (selected at random from 'votes', without replacement)

dinc

Number of ballots to be deleted in subsequent steps

dlimit

Maximum number of ballots to delete (in addition to 'dstart')

drep

Maximum number of elections (required if 'dinc=0')

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.

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

Value

'SafeRankExpt' object, describing this experiment and its results

Examples

data(food_election)
testDeletions(food_election)
testDeletions(food_election, countMethod="stv",
  countArgs=list(complete.ranking=TRUE))


SafeVote documentation built on Oct. 6, 2024, 1:07 a.m.