Skip to contents

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)
#> Number of ballots counted by stv: 20, 18, 16, 14, 12, 10, 8, 6, 4, 2
#> 
#> Results of testDeletions at 2023-01-18 01:51:21
#> 
#> Dataset = food_election, countMethod = stv, rankMethod = safeRank
#> 
#> |             | dstart| dinc| dlimit| drep|
#> |:------------|------:|----:|------:|----:|
#> |otherFactors |     20|    2|      2|   10|
#> 
#> Unit factors: initSample, removedBallots
#> 
#> Experiment ID, number of ballots in simulated election, ranks, winning margins:
#> 
#> |exptID | nBallots| Oranges| Pears| Chocolate| Strawberries| Sweets| m.Oranges|  m.Pears| m.Chocolate| m.Strawberries| m.Sweets|
#> |:------|--------:|-------:|-----:|---------:|------------:|------:|---------:|--------:|-----------:|--------------:|--------:|
#> |CDS0   |       20|       2|     2|         1|            2|      2| 6.0000000| 0.000000|    8.000000|      4.5548889| 2.777444|
#> |CDS1   |       18|       2|     2|         1|            2|      2| 6.0000000| 0.000000|    6.000000|      3.3994000| 2.599600|
#> |CDS2   |       16|       2|     2|         1|            2|      2| 6.0000000| 2.000000|    4.000000|      2.6660417| 0.000000|
#> |CDS3   |       14|       1|     1|         1|            1|      1| 5.0000000| 1.000000|    8.000000|      2.3327619| 1.999571|
#> |CDS4   |       12|       1|     1|         1|            1|      1| 4.0000000| 0.000000|    7.000000|      2.3326667| 1.666333|
#> |CDS5   |       10|       1|     1|         1|            1|      1| 3.0000000| 0.000000|    6.000000|      1.9994000| 1.666267|
#> |CDS6   |        8|       1|     1|         1|            1|      1| 3.0000000| 1.000000|    4.000000|      1.3323333| 1.000000|
#> |CDS7   |        6|       1|     1|         1|            1|      1| 3.0000000| 1.000000|    2.000000|      1.0000000| 0.000000|
#> |CDS8   |        4|       1|     1|         1|            1|      1| 1.6656667| 1.665667|    2.665667|      0.6656667| 0.000000|
#> |CDS9   |        2|       1|     1|         1|            1|      1| 0.3323333| 1.000000|    1.000000|      0.0000000| 0.000000|
testDeletions(food_election, countMethod="stv",
  countArgs=list(complete.ranking=TRUE))
#> Number of ballots counted by stv: 20, 18, 16, 14, 12, 10, 8, 6, 4, 2
#> 
#> Results of testDeletions at 2023-01-18 01:51:21
#> 
#> Dataset = food_election, countMethod = stv, rankMethod = safeRank
#> 
#> |          | complete.ranking|
#> |:---------|----------------:|
#> |countArgs |             TRUE|
#> 
#> 
#> |             | dstart| dinc| dlimit| drep|
#> |:------------|------:|----:|------:|----:|
#> |otherFactors |     20|    2|      2|   10|
#> 
#> Unit factors: initSample, removedBallots
#> 
#> Experiment ID, number of ballots in simulated election, ranks, winning margins:
#> 
#> |exptID | nBallots| Oranges| Pears| Chocolate| Strawberries| Sweets| m.Oranges| m.Pears| m.Chocolate| m.Strawberries|  m.Sweets|
#> |:------|--------:|-------:|-----:|---------:|------------:|------:|---------:|-------:|-----------:|--------------:|---------:|
#> |GIA0   |       20|       2|     2|         1|            2|      2|         4|       2|           8|       6.777111| 3.8885556|
#> |GIA1   |       18|       2|     2|         1|            2|      2|         3|       2|           8|       6.090273| 3.9087273|
#> |GIA2   |       16|       2|     2|         1|            2|      2|         3|       1|           7|       6.132633| 3.1997000|
#> |GIA3   |       14|       2|     2|         1|            2|      2|         2|       1|           7|       6.184407| 2.4812593|
#> |GIA4   |       12|       3|     3|         1|            2|      3|         2|       1|           6|       4.249125| 0.7498750|
#> |GIA5   |       10|       3|     3|         1|            2|      3|         2|       0|           5|       3.570571| 0.7617619|
#> |GIA6   |        8|       2|     2|         1|            2|      2|         2|       0|           4|       3.888056| 0.7776111|
#> |GIA7   |        6|       2|     2|         1|            2|      2|         1|       0|           4|       3.199200| 0.7998000|
#> |GIA8   |        4|       2|     2|         1|            2|      2|         1|       0|           2|       2.332333| 0.0000000|
#> |GIA9   |        2|       3|     3|         1|            2|      3|         0|       0|           2|       1.665667| 0.0000000|