Electoral volatility calculation: Pedersen (1979), Powell and Tucker (2014) and Torcal and Lago (2015).
evolat( tidy_data, method, threshold = 2, summary = FALSE, digits = 2, scale = 100 )
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 |
if summary = FALSE,
return data.frame.
if summary = TRUE
, return a list with two data.frame.
list[[1]]
Indicator
list[[2]]
Summary by 'unit'
min
variable 'election'
max
variable 'election'
number of elections
mean
indicator
standard deviation
indicator
Nicolas Schmidt nschmidt@cienciassociales.edu.uy
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)#> election unit eVolat #> 1 2000 ARG 20 #> 2 2005 ARG 20 #> 3 2010 ARG 15evolat(tidy_data = votes, method = 1, summary = TRUE)#> [[1]] #> election unit eVolat #> 1 2000 ARG 20 #> 2 2005 ARG 20 #> 3 2010 ARG 15 #> #> [[2]] #> unit first_elec last_elec election mean_volat sd_volat #> 1 ARG 2000 2010 3 18.33 2.89 #>