enp: Effective Number of Parties

Description Usage Arguments Value Author(s) Examples

View source: R/enp.R

Description

The Effective Number of Parties (ENP) is an index developed by Laakso and Taagepera (1979) that allows to count the relevant parties in a party system. The formula consists on dividing one over the sum of the squares of the proportions (votes or seats) that the parties obtain in an electoral instance.

Usage

1
enp(tidy_data, enp_seats = FALSE, summary = FALSE)

Arguments

tidy_data

data.frame that contains the following variables with these names:

  • election: year of election.

  • unit: the unit of analysis (province, department ...)

  • party: name of the political parties that obtain votes.

  • votes: votes obtained by each party.

  • seats: .

If the data is not structured in this way you can order it with: convert_esaps.

enp_seats

enp_seats = TRUE allows us to calculate jointly the effective number of electoral parties and in the congress.

summary

Summary of the data by unit, by default it is FALSE.

Value

if summary = FALSE, return data.frame.

if summary = TRUE, return a list with two data.frame.

Author(s)

Nicolas Schmidt nschmidt@cienciassociales.edu.uy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
votes <- data.frame(election = rep(c(2000, 2005), each = 4),
                   unit  = rep(c("ARG", "URY"), each = 4),
                   party = c("party_A", "party_B","party_C","party_D"),
                   votes = c(20, 20, 50, 10, 30, 35, 25, 10),
                   seats = c(25, 25, 40, 10, 30, 30, 30, 10)
                   )

enp(votes)
enp(votes, enp_seats = TRUE)
enp(votes, summary = TRUE)

esaps documentation built on Sept. 14, 2021, 1:07 a.m.