Learn R Programming

elec.strat (version 0.1.1)

getEbsMargin: Updating Error Bounds and Margin Given the Observed Maximum

Description

Gives updated values u and M given a value of the observed maximum t.

Usage

getEbsMargin(Z, t, asTaint = FALSE, asNumber = FALSE, M = NULL)

Arguments

Z
A strat.elec.data object.
t
Value of the observed maximum, either as the MRO, as taint, or as the overstatement of the margin in votes.
asTaint
Set asTaint = TRUE if t is the maximum observed taint.
asNumber
Set asNumber if t is the maximum observed overstatement of the margin in votes.
M
A priori margin. If NULL, M defaults to 1.

Details

Creates values u and margin M that can be passed into the branch and bound function. The following definitions for u and M are described in Higgins, Rivest, Stark. The quantity e.max is obtained through maximumMarginBound.
  • Default u = e.max - min(e.max, t). M = M - sum(min(e.max, t)).
  • asTaint = TRUE u = e.max*(1 - t). M = M - sum(e.max*t)
  • asNumber = TRUE Same as Default with t = t/Z$Margin.

The output of getEbsMargin is a list consisting of

  • MThe updated margin.
  • uThe updated value vector.

References

M. Higgins, R. L. Rivest, P. B. Stark. Sharper p-Values for Stratified Election Audits

Examples

Run this code
	data(MN_Senate_2006)
	getEbsMargin(MN_Senate_2006.strat, t = 0.009, asTaint = TRUE)

Run the code above in your browser using DataLab