make.sample {elec} | R Documentation |
These methods are for SIMULATION STUDIES. These functions will build a sample, i.e. simulated, record of votes given certain parameters.
make.cartoon(n = 400, vote.dist = c(125, 113, 13), stratify = TRUE) make.sample(M, N, strata = 1, per.winner = NULL, worst.e.max = NULL, R = NULL, tot.votes = 1e+05) make.sample.from.totals(vote.W, vote.L, totals) make.sample.from.totals.margin(M, totals, per.winner = NULL)
M |
The margin desired between the winner and loser. |
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 2. NULL indicates equal size. |
tot.votes |
The total votes desired. |
vote.W |
Total votes for winner. |
vote.L |
Total votes for loser. |
totals |
Vector of total votes for precincts. |
vote.dist |
reported votes for C1, C2, and C3 in order for all precincts.prompt |
n |
Size of sample. |
stratify |
Should the sample be stratified? |
make.cartoon() makes the sample scenario described in Stark's CAST paper.
A elec.data object meeting the desired specifications.
Luke W. Miratrix
See http://www.stat.berkeley.edu/~stark/Vote/index.htm for relevant information.
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)