evolat: Electoral volatility calculation

Description Usage Arguments Examples

Description

Electoral volatility calculation: Pedersen (1979), Powell and Tucker (2014) and Torcal and Lago (2015).

Usage

1
evolat(esapsObject, method, threshold = 2, summary = FALSE, digits = 2)

Arguments

esapsObject

An esaps class object. Function: esaps_object.

method

Method to calculate electoral volatility: "Pedersen", "Powell and Tucker" or "Torcal and Lago".

threshold

Minimum threshold for 'Type A' electoral volatility calculation (Powell and Tucker, 2014). By default is 2%.

summary

Summary of data by country, by default it is FALSE.

digits

integer indicating the number of decimal places to be used.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
votes <- list(data.frame(country = rep("ARG", 3),
                         year = c(1995, 2000, 2005),
                         party_A = c(40,10,20),
                         party_B = c(35,20,40),
                         party_C = c(25,70,40)),
              data.frame(country = rep("URY", 4),
                         year = c(1995, 2000, 2005, 2010),
                         party_A = c(30,30,20,20),
                         party_B = c(30,50,40, 30),
                         party_C = c(30,10,30, 25),
                         party_D = c(10,10,10,25)),
              data.frame(country = rep("BRA", 2),
                         year = c(1993, 1998),
                         party_A = c(30, 55),
                         party_B = c(70, 45)))

votes <- esaps_object(dataset = votes, name.country = "country", name.year = "year")
volatility <- evolat(esapsObject = votes, method = "Pedersen", summary = TRUE)

Nicolas-Schmidt/old_esaps documentation built on May 17, 2019, 3:13 a.m.