simulateIt: simulate KM audits

View source: R/KM_package.R

simulateItR Documentation

simulate KM audits

Description

This takes an election and a truth and conducts a KM audit.

Usage

simulateIt(
  data,
  M = 50,
  alpha = 0.25,
  plot = FALSE,
  debug = FALSE,
  return.Ps = FALSE,
  truncate.Ps = TRUE
)

Arguments

data

a data frame, one row per patch, with: tot.votes, e.max, taint

M

the maximum number of samples to draw before automatically escalating to a full recount.

alpha

level of risk.

plot

plot a chart?

debug

debug diag printed?

return.Ps

Return the sequence of p-values all the way up to N.

truncate.Ps

Return Ps only up to where audit stopped.

Details

Given a list of all precincts and their true taints and their sampling weights (in data, a data.frame), do a sequential audit at the specified alpha.

Value

stopPt - number of draws drawn n - number of unique precincts audited


elec documentation built on April 27, 2022, 1:05 a.m.