Learn R Programming

elec (version 0.1.2.2)

Collection of Functions for Statistical Election Audits

Description

This is a (somewhat bizarre) collection of functions written to do various sorts of statistical election audits. There are also functions to generate simulated voting data, including methods to simulation different types of voting errors which allow for simulations for checking the characteristics of these methods.

Copy Link

Version

Install

install.packages('elec')

Monthly Downloads

208

Version

0.1.2.2

License

GPL (>= 2)

Maintainer

Luke Miratrix

Last Published

April 26th, 2022

Functions in elec (0.1.2.2)

CAST.audit

Given audit data, compute p.values and all that.
audit.plan

Audit Plans for CAST and Trinomial Methods
KM.calc.sample

Calculate sample size for KM-audit.
CAST.calc.sample

Construct a sample for auditing using CAST
KM.audit

KM Audit Calculator
AuditErrors

Functions that Compute Error Levels Given Audit Data
CAST.sample

Sample from the various strata according to the schedule set by 'ns'. Ignore all precincts that are known (i.e., have been previously audited).
audit.totals.to.OS

Converting total vote counts to Over Statements
compute.audit.errors

Calculate the measured error in each of the audited precicnts.
CAST.calc.opt.cut

Calculate Optimal CAST plan
do.audit

do.audit
find.q

find.q
make.cartoon

Make the cartoon example from the CAST paper as a voter data matrix.
make.audit.from.Z

Make a fake audit given specified error for simulations
elec.data

core election audit data structure
santa.cruz.audit

Santa Cruz Election Data
sim.race

Simulate CAST audits to assess performance
elec-package

Statistical Election Audits Package
compute.stark.t

compute.stark.t
make.opt.packed.bad

make.truth.opt.bad
yolo

Yolo County, CA Election Data
marin

Marin Measure B Reported Results
weight.function

weight functions
print.audit.plan.KM

Pretty print KM audit plan
make.truth

Make baseline truth for simulations
truth.looker

Looking at fake ``truths'' for election simulations
santa.cruz

Santa Cruz Election Data
fractionOfVotesBound

Fraction of votes bound
make.random.truth

making fake truth for electios
maximumMarginBound

Election Audit Error Bound Functions
is.elec.data

Check if object is elec.data object
opt.sample.size

KM Audit Sample Size Calc
find.stark.SRS.p

find.stark.SRS.p
find.stratification

find.stratification
tri.sample

Sample from List of Precincts PPEB
tri.audit.sim

tri.audit.sim
tri.calc.sample

Calculate needed sample size for election auditing using the Trinomial Bound
make.sample

Generate fake election results for simulation studies
countVotes

countVotes
make.sample.from.totals

Make sample from vote totals (for simulations)
tri.sample.stats

Utility function for tri.sample
simulateIt

simulate KM audits
trinomial.audit

Conduct trinomial audit
trinomial.bound

Auditing with the Trinomial Bound: trinomial.bound and trinomial.audit
stark.test.Z

Workhorse driver for stark.test