evolat {esaps} | R Documentation |
Electoral volatility calculation
Description
Electoral volatility calculation: Pedersen (1979), Powell and Tucker (2014) and Torcal and Lago (2015).
Usage
evolat(
tidy_data,
method,
threshold = 2,
summary = FALSE,
digits = 2,
scale = 100
)
Arguments
tidy_data |
data.frame that contains the following variables with these names:
If the data is not structured in this way you can order it with: |
method |
Method to calculate electoral volatility:
|
threshold |
Minimum threshold for 'Type A' electoral volatility calculation (Powell and Tucker, 2014). By default is 2%. |
summary |
Summary of data by unit, by default it is |
digits |
integer indicating the number of decimal places to be used. |
scale |
By default it is |
Value
if summary = FALSE,
return data.frame.
if summary = TRUE
, return a list with two data.frame.
list[[1]]
Indicatorlist[[2]]
Summary by 'unit'min
variable 'election'max
variable 'election'number of elections
mean
indicatorstandard deviation
indicator
Author(s)
Nicolas Schmidt nschmidt@cienciassociales.edu.uy
Examples
votes <- data.frame(election = rep(c(1995, 2000, 2005, 2010),4),
unit = "ARG",
party = rep(c("party_A","party_B","party_C","party_D"), each = 4),
votes = c(30,30,20,20,30,50,40,30,30,10,30,25,10,10,10,25))
evolat(votes, 1)
evolat(tidy_data = votes, method = 1, summary = TRUE)