Package 'politicsR'

Title: Calculating Political System Metrics
Description: A toolbox to facilitate the calculation of political system indicators for researchers. This package offers a variety of basic indicators related to electoral systems, party systems, elections, and parliamentary studies, as well as others. Main references are: Loosemore and Hanby (1971) <doi:10.1017/S000712340000925X>; Gallagher (1991) <doi:10.1016/0261-3794(91)90004-C>; Laakso and Taagepera (1979) <doi:10.1177/001041407901200101>; Rae (1968) <doi:10.1177/001041406800100305>; Hirschmaņ (1945) <ISBN:0-520-04082-1>; Kesselman (1966) <doi:10.2307/1953769>; Jones and Mainwaring (2003) <doi:10.1177/13540688030092002>; Rice (1925) <doi:10.2307/2142407>; Pedersen (1979) <doi:10.1111/j.1475-6765.1979.tb01267.x>; SANTOS (2002) <ISBN:85-225-0395-8>.
Authors: Denisson Silva [aut, cre] , Willber Nascimento [aut] , Fernando Meireles [aut] , Jose Alexandre [aut]
Maintainer: Denisson Silva <[email protected]>
License: GPL (>= 3)
Version: 0.1.0
Built: 2025-03-05 02:45:41 UTC
Source: https://github.com/silvadenisson/politicsr

Help Index


Brazilian Lower Chamber Electoral Results

Description

A dataset containing data on electoral results for the Brazilian lower chamber by party and by state from 1990 to 2018. The variables include country name, year and month of election, electoral district name and code, party name and code, and party vote share.

Usage

brazil

Format

## 'brazil' A data frame with rows and columns:

ctr_n

Country name

yr

Year of election

mn

Month of election

cst_n

Name of electoral district

cst

Code of electoral district

pty_n

Party name

pty

Party code

pvs1

Party vote share

Details

This dataset is part of the Constituency-Level Elections Archive (CLEA) project, a repository that provides detailed election results at the constituency level for lower chamber and upper chamber legislative elections from around the world.

Value

This dataset is part of the Constituency-Level Elections Archive (CLEA). Brazilian Lower Chamber Electoral Results

Source

<https://electiondataarchive.org/>

References

Kollman, K., Hicken, A., Caramani, D., Backer, D., & Lublin, D. (2019). Constituency-level elections archive [data file and codebook]. Ann Arbor, MI: Center for Political Studies, University of Michigan [producer and distributor]. Retrieved from http://www.electiondataarchive.org.


Danish Lower Chamber Electoral Results

Description

A dataset containing data on electoral results for the Danish lower chamber by party and by electoral district from 1906 to 2019 (except the 1915 election). The variables include country name, year and month of election, electoral district name and code, party name and code, and party vote share.

Usage

denmark

Format

## 'denmark' A data frame with rows and columns:

ctr_n

Country name

yr

Year of election

mn

Month of election

cst_n

Name of electoral district

cst

Code of electoral district

pty_n

Party name

pty

Party code

pvs1

Party vote share

Details

This dataset is part of the Constituency-Level Elections Archive (CLEA) project, a repository that provides detailed election results at the constituency level for lower chamber and upper chamber legislative elections from around the world.

Value

This dataset is part of the Constituency-Level Elections Archive (CLEA). Danish Lower Chamber Electoral Results

Source

<https://electiondataarchive.org/>

References

Kollman, K., Hicken, A., Caramani, D., Backer, D., & Lublin, D. (2019). Constituency-level elections archive [data file and codebook]. Ann Arbor, MI: Center for Political Studies, University of Michigan [producer and distributor]. Retrieved from http://www.electiondataarchive.org.


The Effective Number of Parties Index

Description

'enp()' calculates the number of Effective Political Parties according to the formula proposed by Laakso and Taagepera (1979).

Usage

enp(x)

Arguments

x

(numeric). A numeric vector in the form of a proportion of votes or seats. The vector should between from 0 to 1.

Value

A value corresponding to the number of effective parties. Normally we deprecate the fraction in the analysis, leaving only the integer.

References

Laakso, M., & Taagepera, R. (1979). “Effective” Number of Parties: A Measure with Application to West Europe. Comparative Political Studies, 12(1), 3–27. https://doi.org/10.1177/001041407901200101

Examples

enp(c(0.2, 0.3, 0.5))

Fractionalization Index

Description

'fractionalization()' calculates the rate of electoral fractionalization according to Douglas Rae's (1968) formula.

Usage

fractionalization(x)

Arguments

x

(numeric). A numeric vector in the form of a proportion of votes or seats. The vector should range from 0 to 1.

Value

Returns a numerical vector with the estimate of party fractionalization. The result of the index is a value between 0 and 1. The closer to zero, the lower the fractionalization; the closer to 1, the higher the fractionalization.

References

Rae, D. (1968). A note on the fractionalization of some European party systems. Comparative Political Studies, 1(3), 413-418.

Examples

fractionalization(c(0.2, 0.3, 0.5))

Herfindahl–Hirschman concentration index

Description

'hh()' calculates the Herfindahl–Hirschman concentration index.

Usage

hh(x)

Arguments

x

(numeric). A numeric vector in the form of a proportion of votes or seats. The vector should range from 0 to 1.

Value

The result of the index is a value between 0 and 1. The closer to zero, the lower the concentration; the closer to 1, the higher the concentration.

References

Hirschmaņ, Albert O. (1945). National Power and Structure of Foreign Trade, Berkley: Univ of California Press.

Herfindahl, Orris C. (1950). Concentration in the us steel industry. Unpublished PhD. Dissertation, Columbia University.

Examples

hh(c(0.2, 0.3, 0.5))

Hyperfractionalization Index

Description

'hiperfrac' calculates the hyperfractionalization index proposed by Kesselman (1966) and Wildgen (1971), which is useful for party system with many small parties.

Usage

hiperfrac(x)

Arguments

x

(numeric). A number vector in the form of a proportion of votes or seats. The vector should range from 0 to 1.

Details

This index places more weights to small parties compared to the Effective Number of Political Parties Index ('enp')

Value

A continued value, the larger the higher the fragmentation of the system

References

Kesselman, M. (1966). French Local Politics: A Statistical Examination of Grass Roots Consensus. American Political Science Review, 60(4), 963-973. doi:10.2307/1953769

Wildgen, J. K. (1971). The Measurement of Hyperfractionalization. Comparative Political Studies, 4(2), 233–243. https://doi.org/10.1177/001041407100400205

Examples

hiperfrac(c(0.1, 0.1, 0.05, 0.05, 0.01, 0.04, 0.65))

Loosemore–Hanby Index

Description

'lh()' calculates the electoral disproportionality between votes and seats as proposed by Loosemore and Hanby (1971).

Usage

lh(x, y)

Arguments

x

(numeric). Numeric vector with the vote share of parties

y

(numeric). Numeric vector with the seat share of parties

Value

If the input is a proportion the result is between 0 and 1. But if the input is a percentage it is between 0 and 100. In both cases the higher the value, the more disproportional the electoral system is.

References

Loosemore, J., & Hanby, V. (1971). The Theoretical Limits of Maximum Distortion: Some Analytic Expressions for Electoral Systems. British Journal of Political Science, 1(4), 467-477. doi:10.1017/S000712340000925X

Examples

votes <- c(0.2, 0.2, 0.6)
seats <- c(0.18, 0.17, 0.65)
lh(votes, seats)

Least Squares Index

Description

'lsq()' calculates the electoral disproportionality between votes and seats by Least squares index method as proposed by Michael Gallagher.

Usage

lsq(x, y)

Arguments

x

(numeric). Numeric vector with the vote share of parties

y

(numeric). Numeric vector with the seat share of parties

Value

If the input is a proportion the result is between 0 and 1. But if the input is a percentage it is between 0 and 100. In both cases the higher the value, the more disproportional the electoral system is.

References

Gallagher, M. (1991). Proportionality, disproportionality and electoral systems. Electoral studies, 10(1), 33-51.

Examples

votes <- c(0.2, 0.2, 0.6)
seats <- c(0.18, 0.17, 0.65)
lsq(votes, seats)

Party Nationalization Index

Description

'nationalization()' calculates the Party Nationalization Index as proposed by Jones e Mainwaring (2003).

Usage

nationalization(x)

Arguments

x

(numeric). A numeric vector with the vote share for a given party x in each electoral district.

Value

The result of the index is a value between 0 and 1. A high score indicates a high level of nationalization

References

Jones, M. P., & Mainwaring, S. (2003). The Nationalization of Parties and Party Systems: An Empirical Measure and an Application to the Americas. Party Politics, 9(2), 139–166. https://doi.org/10.1177/13540688030092002

Examples

x <- runif(27, 0.03, 0.2)
nationalization(x)

Parliamentary Renewal

Description

'renewal' calculates parliamentary renewal rates

Usage

renewal(
  seats = NULL,
  dropout = NULL,
  defeated = NULL,
  reelected = NULL,
  type = "all"
)

Arguments

seats

(numeric). Number of legislative seats in dispute

dropout

(numeric). Number of parliamentarians who gave up the legislative career and vacancy for various reasons

defeated

(numeric). Number of defeated parliamentarians

reelected

(numeric). Number of re-elected parliamentarians

type

(character). type of renewal to be calculated. by default it is "all". But only one renewal can be chosen: "grr" (gross renewal rate), "crr" (compulsory renewal rate), "nrr" (net renewal rate).

Details

gross renewal rate = ((dropout + defeated) / seats) * 100

compulsory renewal rate = (dropout / seats) * 100

net renewal rate = (defeated / (reelected + defeated)) * 100

Value

A percentage which is the Renewal Rate. See parameter type.

References

SANTOS, W. G. D. (2002). Votos e partidos: almanaque de dados eleitorais. Brasil e outros países. Rio de Janeiro: Editora FGV.

Examples

seats <- 27
dropout <- 9
defeated <- 6
reelected <- 12

renewal(seats, dropout, defeated, reelected)

Rice Index

Description

'rice' proposed by Rice (1925) is used to measure party cohesion in parliamentary votes by considering two voting blocks (usually government and opposition)

Usage

rice(x)

Arguments

x

(factor). A factor vector with two levels (i.e., Yay or Nay)

Value

The index ranges from 0 to 1, where 1 is complete cohesion and 0 the formation of two equally sized subgroups within the party.

References

Rice, S. A. (1925). The Behavior of Legislative Groups: A Method of Measurement. Political Science Quarterly, 40(1), 60–72. https://doi.org/10.2307/2142407

Examples

voting <- as.factor(c(rep("Yes", 90), rep("No", 10)))
rice(voting)

Spanish Lower Chamber Electoral Results

Description

A dataset containing data on electoral results for the Spanish lower chamber by party and by electoral district from 1977 to 2019. The variables include country name, year and month of election, electoral district name and code, party name and code, and party vote share.

Usage

spain

Format

## 'spain' A data frame with rows and columns:

ctr_n

Country name

yr

Year of election

mn

Month of election

cst_n

Name of electoral district

cst

Code of electoral district

pty_n

Party name

pty

Party code

pvs1

Party vote share

Details

This dataset is part of the Constituency-Level Elections Archive (CLEA) project, a repository that provides detailed election results at the constituency level for lower chamber and upper chamber legislative elections from around the world.

Value

This dataset is part of the Constituency-Level Elections Archive (CLEA) projec. Spanish Lower Chamber Electoral Results

Source

<https://electiondataarchive.org/>

References

Kollman, K., Hicken, A., Caramani, D., Backer, D., & Lublin, D. (2019). Constituency-level elections archive [data file and codebook]. Ann Arbor, MI: Center for Political Studies, University of Michigan [producer and distributor]. Retrieved from http://www.electiondataarchive.org.


T Imbalance Index

Description

'tbi()' calculates T index of inbalance according to the proposition of Taagepera (1979).

Usage

tbi(x)

Arguments

x

(numeric). A number vector with share of votes or seats. The vector should range from 0 to 1 (if not, the function will automatically make the vector elements sum to one).

Value

The index ranges from 0 to 1, with 0 being total equilibrium, and 1 total imbalance. When used as an indicator of competitiveness, 0 is the scenario of total competitiveness and 1 is a scenario dominated by one or a few competitors.

References

Taagepera, R. (1979). Inequality, Concentration, Imbalance. Political Methodology, 6(3), 275–291. http://www.jstor.org/stable/25791080

Examples

tbi(c(0.2, 0.3, 0.5))

Electoral Volatility Index

Description

'volatility()' calculates electoral volatility index developed by Perdersen (1979).

Usage

volatility(x, y)

Arguments

x

(numeric). Numeric vector with the vote share for selected parties in a given election in t.

y

(numeric). Numeric vector with the vote share for selected parties in the t+1 election.

Value

If the input is a proportion the result is between 0 and 1. But if the input is a percentage it is between 0 and 100. In both cases the higher the value the more volatile is the electoral system.

References

Pedersen, M. N. (1979). The dynamics of European party systems: changing patterns of electoral volatility. European journal of political research, 7(1), 1-26.

Examples

x <- c(0.3, 0.7)
y <- c(0.5, 0.5)
volatility(x, y)