Description Usage Arguments Details Value Author(s) See Also Examples

tri.sample selects a sample of precincts PPEB. Namely, samples n times, with replacement, from the precincts proportional to the weights of the precincts.

1 2 3 | ```
tri.sample(Z, n, seed = NULL, print.trail = FALSE, simplify = TRUE,
return.precincts = TRUE, PID = "PID", known = "known")
tri.sample.stats(samp)
``` |

`Z` |
elec.data object |

`n` |
Either a audit.plan.tri object (that contains n) or an integer which is the size of the sample |

`seed` |
Seed to use. |

`print.trail` |
Print diagnostics and info on the selection process. |

`simplify` |
If TRUE, return a data frame of unique precincts sampled, with counts of how many times they were sampled. Otherwise return repeatedly sampled precincts seperately. |

`return.precincts` |
Return the precincts, or just the precint IDs |

`PID` |
The name of the column in Z\$V holding unique precinct IDs |

`known` |
Name of column in Z\$V of TRUE/FALSE, where TRUE are precincts that are considered “known”, and thus should not be sampled for whatever reason. |

`samp` |
A sample, such as one returned from tri.sample |

The weights, if passed, are in the “e.max” column of Z\$V.

tri.sample returns a sample of precincts. tri.sample.stats is a utility function returning the total number of unique precincts and ballots given a sample.

Luke W. Miratrix

`trinomial.bound`

`elec.data`

`tri.calc.sample`

`audit.plan.tri`

1 2 3 4 5 | ```
data(santa.cruz)
Z = elec.data( santa.cruz, C.names=c("danner","leopold") )
samp = tri.calc.sample( Z, beta=0.75, guess.N = 10, p_d = 0.05,
swing=10, power=0.9, bound="e.plus" )
tri.sample( Z, samp, seed=541227 )
``` |

elec documentation built on May 30, 2017, 5:51 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.