| Title: | Detecting Election Fraud from Irregularities in Vote-Share Distributions |
|---|---|
| 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. |
| Authors: | Arturas Rozenas |
| Maintainer: | Arturas Rozenas <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.1 |
| Built: | 2026-05-15 10:15:26 UTC |
| Source: | https://github.com/cran/spikes |
Estimates credible interval by (1) taking a draw from the posterior density (2) implementing the RKD step. The procedure is repeated boot times.
confInt(object, boots = 100)confInt(object, boots = 100)
object |
object of class |
boots |
number of samples from the posterior; defaul |
Synthetic dataset
data("data")data("data")
Precinct-level election data from the 2011 Canadian parliamentary elections..
Nnumber of registered voters
tturnout
vvotes for the Conservative party
data(data)data(data)
An object of class out returned by spikes or confint.out.
data("output")data("output")
data(output) plot(output)data(output) plot(output)
spikes
Plots the observed kernel density of data and the upper envelope of the resampled densities.
## S3 method for class 'out' plot(x, main = NULL, ...)## S3 method for class 'out' plot(x, main = NULL, ...)
x |
Object of class |
main |
Title, |
... |
additional plotting arguments |
data(output) plot(output)data(output) plot(output)
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).
spikes(data, resamples = 1000, bw = 1e-04, grid = 1001, out = NULL)spikes(data, resamples = 1000, bw = 1e-04, grid = 1001, out = NULL)
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 |
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 plot.out, summary.out
data(data) ## Not run: out <- spikes(data, resamples = 1000) ## End(Not run)data(data) ## Not run: out <- spikes(data, resamples = 1000) ## End(Not run)
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.
## S3 method for class 'out' summary(object, ...)## S3 method for class 'out' summary(object, ...)
object |
Object of class |
... |
additional arguments |
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.
data(output) summary(output)data(output) summary(output)