Type: | Package |
Title: | Detecting Election Fraud from Irregularities in Vote-Share Distributions |
Version: | 1.1 |
Depends: | R (≥ 3.2.2), emdbook |
Date: | 2016-09-21 |
Author: | Arturas Rozenas |
Maintainer: | Arturas Rozenas <ar199@nyu.edu> |
Description: | Applies re-sampled kernel density method to detect vote fraud. It estimates the proportion of coarse vote-shares in the observed data relative to the null hypothesis of no fraud. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
NeedsCompilation: | no |
Packaged: | 2016-09-22 00:05:38 UTC; arturasrozenas |
Repository: | CRAN |
Date/Publication: | 2016-09-22 02:27:04 |
Credible interval
Description
Estimates credible interval by (1) taking a draw from the posterior density (2) implementing the RKD step. The procedure is repeated boot
times.
Usage
confInt(object, boots = 100)
Arguments
object |
object of class |
boots |
number of samples from the posterior; defaul |
Example data
Description
Synthetic dataset
Usage
data("data")
Format
Precinct-level election data from the 2011 Canadian parliamentary elections..
N
number of registered voters
t
turnout
v
votes for the Conservative party
Examples
data(data)
Ouput object
Description
An object of class out
returned by spikes
or confint.out
.
Usage
data("output")
Examples
data(output)
plot(output)
Plots output of spikes
Description
Plots the observed kernel density of data and the upper envelope of the resampled densities.
Usage
## S3 method for class 'out'
plot(x, main = NULL, ...)
Arguments
x |
Object of class |
main |
Title, |
... |
additional plotting arguments |
Examples
data(output)
plot(output)
Fraud-detection from vote-share data
Description
Implements the resampled kernel density method to detect the excess number of election results with coarse vote-shares (a coarse vote-share is a fraction with a low denominator).
Usage
spikes(data, resamples = 1000, bw = 1e-04, grid = 1001, out = NULL)
Arguments
data |
Data frame with three columns with names |
resamples |
Number of resamples; default |
bw |
Bandwidth for kernel density; default |
grid |
Number of points on which the density is estimated; default |
out |
Object containing parameters of beta-mixture model. If |
Value
spikes
returns object of class out
.
fraud |
Estimated percentage of polling stations with fraud. |
ymax |
Upper envelope of kernel density samples. |
w |
Weights for each bin: the proportion of observations falling into a bin. |
out |
Maximum likelihood estimates of the mixture beta binomial parameters for turnout and votes. |
data |
Data used in estimation. |
See Also
See Also plot.out
, summary.out
Examples
data(data)
## Not run:
out <- spikes(data, resamples = 1000)
## End(Not run)
Internal functions
Description
Internal functions, should not be called by user
Summarize
Description
Extracts estimate of fraud and 95 percent credible interval (if such is estimated) for the object of class out
returned by spikes
or confint.out
.
Usage
## S3 method for class 'out'
summary(object, ...)
Arguments
object |
Object of class |
... |
additional arguments |
Note
If the argument is from spikes
, then summary
returns degenerate credible interval, as it was not estimated. To return a proper credible interval, confint.out
must take as its argument object returned by confint.out
.
Examples
data(output)
summary(output)