Description Usage Arguments Value Examples
View source: R/ComputeKlimekModel.R
This function helps to estimate the Klimek et al.(2012) model.
1 | ComputeKlimekModel(data, Candidates, Level, TotalReg, TotalVotes, 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 |
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 - data frame with results
html - html table with results
tex - tex table with results
sigMatrix - significance matrix
1 2 3 4 5 6 7 | library(EFToolkit)
dat<-read.csv(system.file("Albania2013.csv", package="EFToolkit"))
#NB! R=100 to speed up computations for this example.
klimek<-ComputeKlimekModel(dat, Candidates="C050", Level="National",
TotalReg="Registered", TotalVotes="Ballots", cores=1, R=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.