Description Usage Arguments Value Examples
View source: R/BasicElectionForensics.R
This function helps to run basic election forensics methods: Benford's 2nd Digit, Last Digit (Counts), Counts (05s), Multimodality Test, Sobyanin-Sukhovolsky test and Correlation test.
1 2 | BasicElectionForensics(data, Candidates, Level,
TotalReg, TotalVotes, Methods, R=1000, cores=2)
|
data |
data frame |
Candidates |
variable name referring to vote counts for candidates/parties |
Level |
variable name depicting the level of analysis ("National", i.e. whole dataset by default) |
TotalReg |
variable name for the total number of eligible voters |
TotalVotes |
variable name for the total number of ballots cast |
Methods |
|
R |
number of simulations (1000 simulations by default) |
cores |
number of cores for parallel computing (2 cores by default) |
A list with the following parameters:
table - dataframe with results
html - html table with results
tex - tex table with results
sigMatrix - significance matrix
1 2 3 4 5 6 7 8 9 10 11 12 | library(EFToolkit)
dat<-read.csv(system.file("Albania2013.csv", package="EFToolkit"))
#NB! R=100 to speed up computations for this example.
eldata<-BasicElectionForensics(dat,
Candidates=c("C035", "C050"),
Level="Prefectures", TotalReg="Registered",
TotalVotes="Ballots",
Methods=c("P05s", "C05s", "_2BL", "Sobyanin",
"DipT", "Skew", "Kurt", "Correlation"), cores=2, R=100)
eldata
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.