make.sample | R Documentation |
These methods are for SIMULATION STUDIES. These functions will build a sample, i.e. simulated, record of votes given certain parameters.
make.sample( M, N, strata = 1, per.winner = NULL, worst.e.max = NULL, R = NULL, tot.votes = 1e+05 )
M |
The margin desired between the winner and loser (as a percent). |
N |
Number of precincts desired. |
strata |
Number of strata desired. |
per.winner |
The percent of votes the winner should receive. |
worst.e.max |
The worst e.max possible for any precinct. |
R |
The "dispersion" a measure of how unequal in size precincts should be. R needs to be greater than 0. NULL indicates equal size. For R between 0 and 1, the precincts are distributed 'linearly', i.e., the size of precinct i is proportional to i. At 2, the smallest precint will be near 0 and the largest twice the average votes per precinct. After 2, the precincts are distributed in a more curved fashion so that the smaller precincts do not go negative. |
tot.votes |
The total votes desired. |
A elec.data object meeting the desired specifications.
Luke W. Miratrix
See http://www.stat.berkeley.edu/~stark/Vote/index.htm for relevant information.
elec.data
make.truth
do.audit
Z = make.sample(0.08, 150, per.winner=0.4) Z Z2 = make.sample(0.08, 150, per.winner=0.4, R=2.2) Z2 ## Note how they have different precinct sizes. summary(Z$V$tot.votes) summary(Z2$V$tot.votes)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.