CAST.calc.opt.cut: Calculate Optimal CAST plan

Description Usage Arguments Details Value Author(s) Examples

View source: R/CAST.R

Description

With CAST, it is sometimes advantageous to set aside small precincts and assume they are entirely in error so as to reduce the total number of precincts in the pool that we sample from. This trade-off can increase the power of the audit or, in other terms, allow us to sample fewer precincts as the chance of nabbing the large, dangerous ones is larger.

Of all cuts that produce the smallest n, it returns the smallest cut (since sometimes multiple cut-offs lead to the same sample size).

This function also plots the trade-off of sample size for a specific cut, if the plot flag is TRUE.

Usage

1
CAST.calc.opt.cut(Z, beta = 0.9, stages = 2, t = 3, plot = FALSE, ...)

Arguments

Z

The elec.data object

beta

1-beta is the risk of the audit failing to notice the need to go to a full manual count if it should.

stages

Number of stages in the audit.

t

The allowed vote swing that is not considered a material error.

plot

TRUE/FALSE. Plot the trade-off curve.

...

Extra arguments to the plot command.

Details

This function iteratively passes increasing values of small.cut to CAST.calc.sample and examines the resulting n.

Value

Returns a list.

cut

Size of the optimal cut. All precincts with an error smaller than or equal to cut would not be audited, and instead be assumed to be in full error.

n

Corresponding needed sample size given that cut.

q

The number of tainted precincts that would be needed to throw the election, beyond the ones set aside due to being smaller than cut.

Author(s)

Luke W. Miratrix

Examples

1
2
3
4
5
6
        ## Find optimial cut for  determining which small precincts that
        ## we would set aside and not audit in Santa Cruz
        data(santa.cruz)
        Z = elec.data( santa.cruz, C.names=c("leopold","danner") )

        CAST.calc.opt.cut( Z, beta=0.75, stages=1, t=5, plot=TRUE )

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