ComputeKlimekModel: Compute Klimek Model function

Description Usage Arguments Value Examples

View source: R/ComputeKlimekModel.R

Description

This function helps to estimate the Klimek et al.(2012) model.

Usage

1
ComputeKlimekModel(data, Candidates, Level, TotalReg, TotalVotes, R=1000, cores=2)

Arguments

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)

Value

A list with the following parameters:

Examples

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)

kkalininMI/EFToolkit documentation built on Oct. 28, 2020, 1:47 a.m.