Introduction

The very objective of the SciencesPo package is to provide methods for computing some of the popular measures in political science literature. Apart from their usefulness for categorization, empirical indices intended to capture political abstractions and provide data for causal reasoning. Examples at the core of the discipline include measures of political concentration and fragmentation, political competition, and apportionment methods to transform election results into seats.

This vignette is intended to illustrate some of the applications available in the R library SciencesPo, which can be used to compute those measures of political behavior. The rest of this vignette is organized as follows. Section 2 provides an overview of the technical details and examples of seat apportionment methods. Section 3 illustrates the use of political diversity functions to obtain empirical indices of a political system environment, such as the effective number of parties, the nationalization of political parties, and political competition. Section 4 provides examples of computing proportionality statistics, and section 5 does so for inequality indices.

Seat Apportionment Methods

Most democratic countries use apportionment methods to transform election results into whole numbers, which indicate the number of seats that each party obtained in a legislative body. Which apportionment method does this best is not a trivial topic in political science and that several methods have been proposed. The following sections briefly present some of these apportionment methods.

Highest Averages Methods of Allocating Seats Proportionally

Highest averages methods allocate seats proportionally to the number of votes by assigning seats in a way that assures the highest quotient by seat for each party. Other methods divide the votes by a mathematically derived quota, such as Droop and Hare quotas. In what follows are illustrative examples taken from Lijphart (1994) of the operation of some highest averages formulas in a six member district with four parties.

# Table A.l
lijphart <- c("A"=41000, "B"=29000,"C"=17000, "D"=13000)

The basic imputs for this class of functions are: 1) a list of parties, 2) a list of positive votes, and 3) a constant value for the number of seats to be returned. A numeric value (0~1) for the threshold is optional.

By default, the function prints the apportionment method being used, a snippet of the divisors, the effective number of parties index, and the least squares index–or Gallager index.

d’Hondt

Under the D’Hondt formula, seats are allocated using divisors of 1, 2, 3, 4, etc. Thus, suggesting that the divisors are simply one more than the number of seats that party already has.

library("SciencesPo")

# The d'Hondt will give the same results as Jefferson's method
highestAverages(parties=names(lijphart),
                votes=lijphart,
                seats = 6, 
                method = "dh") 
Method: d'Hondt 
Divisors: 1 2 3 4 ... 
ENP: 3.36 (After): 2.57 
Gallagher Index:  11.6 
 
  Party Seats %Seats
1     A     3  0.500
2     B     2  0.333
3     C     1  0.167
4     D     0  0.000

The d’Hondt is only one way of allocating seats in party list systems. Other methods include the Saint-Laguë, the modified Saint-Laguë, the Danish version, Imperiali (do not to confuse with the Imperiali quota, which is a Largest remainder method), Hungtinton-Hill, Webster, etc.

Saint-Laguë

Named after its founder, the pure Sainte-Laguë formula, also known as Schepers method, uses the odd-integer divisor series (1, 3, 5, 7, …) to elect candidates from political parties in approximate proportion as the proportion of votes won by the party. The outcome would be the same as the outcome produced by the Webster’s divisors method.

# The Sainte-Laguë will give the same results as the Webster's method (wb)
highestAverages(parties=names(lijphart),
                votes=lijphart,
                seats = 6,
                method = "sl") 
Method: Sainte-Laguë 
Divisors: 1 3 5 7 ... 
ENP: 3.36 (After): 3.6 
Gallagher Index:  6.75 
 
  Party Seats %Seats
1     A     2  0.333
2     B     2  0.333
3     C     1  0.167
4     D     1  0.167

Modified Saint-Laguë

The modified Sainte-Laguë use divisors of 1.4, 3, 5, 7, etc. How does the d’Hondt divisor compare to the Modified Sainte-Laguë one? Which divisor method tend to favor larger parties and which one smaller parties?

highestAverages(parties=names(lijphart),
                votes=lijphart, 
                seats = 6,
                method = "msl") 
Method: Modified Sainte-Laguë 
Divisors: 1.4 3 5 7 ... 
ENP: 3.36 (After): 3.6 
Gallagher Index:  6.75 
 
  Party Seats %Seats
1     A     2  0.333
2     B     2  0.333
3     C     1  0.167
4     D     1  0.167

Danish

The Danish divisors (1, 4, 7, 10, …) increase so fast that large parties are quickly cut down, acting much to the benefit of smaller parties.

highestAverages(parties=names(lijphart), 
                votes=lijphart, 
                seats = 6, 
                method = "danish") 
Method: Danish Sainte-Laguë 
Divisors: 1 4 7 10 ... 
ENP: 3.36 (After): 3.6 
Gallagher Index:  6.75 
 
  Party Seats %Seats
1     A     2  0.333
2     B     2  0.333
3     C     1  0.167
4     D     1  0.167

Hungarian

The Hungarian version of Sainte-Laguë uses divisors of (1.5, 3, 5, 7, 9, …) increase so fast that large parties are quickly cut down, acting much to the benefit of smaller parties.

highestAverages(parties=names(lijphart),
                votes=lijphart, 
                seats = 6, 
                method = "hsl") 
Method: Hungarian Sainte-Laguë 
Divisors: 1.5 3 5 7 ... 
ENP: 3.36 (After): 3.6 
Gallagher Index:  6.75 
 
  Party Seats %Seats
1     A     2  0.333
2     B     2  0.333
3     C     1  0.167
4     D     1  0.167

Webster

This approach does not use a standard divisor either. It uses instead a different divisor and modified quota such that rounding with cut-off point at algebraic mean of lower and upper quotas: wb = \(\frac{L + (L + 1)}{2}\).

highestAverages(parties=names(lijphart),
                votes=lijphart, 
                seats = 6, 
                method = "wb") 
Method: Webster 
Divisors: 0.5 2.5 4.5 6.5 ... 
ENP: 3.36 (After): 3.6 
Gallagher Index:  6.75 
 
  Party Seats %Seats
1     A     2  0.333
2     B     2  0.333
3     C     1  0.167
4     D     1  0.167

Imperiali

The Italian Imperiali divisor system has a slowly-increasing sequence (1, 1.5, 2, 2.5, 3, …), with 0.5 difference between consecutive divisors. This is tighter than the d’Hondt divisors for which this difference is 1. Like d’Hondt, the Imperiali system is designed to encourage coalitions and secure majority governments under a PR system, but the Imperiali will be the most favourable to large parties as they will gain many seats before their quotients are reduced below those of the smaller parties.

highestAverages(parties=names(lijphart),
                votes=lijphart, 
                seats = 6, 
                method = "imperiali") 
Method: Imperiali 
Divisors: 1 1.5 2 2.5 ... 
ENP: 3.36 (After): 2.57 
Gallagher Index:  11.6 
 
  Party Seats %Seats
1     A     3  0.500
2     B     2  0.333
3     C     1  0.167
4     D     0  0.000

The Belgian municipal councils were elected by the Imperiali highest averages method. The following example comes from the 2006 election in Bruges, where 47 seats were upon.

Bruges=c("CD&V/N-VA"=32092, "SP.A/Spirit"=20028, 
         "Flemish Interest"=13408, "Open VLD/Vivant"=9520,
         "Green!"=5328, "Other"=2207)

highestAverages(parties=names(Bruges),
                votes=Bruges, 
                seats = 47,
                method = "imperiali") 
Method: Imperiali 
Divisors: 1 1.5 2 2.5 ... 
ENP: 3.93 (After): 3.47 
Gallagher Index:  3.78 
 
             Party Seats %Seats
1        CD&V/N-VA    20  0.426
2      SP.A/Spirit    12  0.255
3 Flemish Interest     8  0.170
4  Open VLD/Vivant     5  0.106
5           Green!     2  0.043
6            Other     0  0.000

Hungtinton-Hill

The method proposed by Joseph Hill and Edward Huntington does not use a standard divisor, but a different one and also a modified quota such that rounding with cut-off point at geometric mean: hh = \(\sqrt{L(L + 1)}\). This method makes sense only if every party is guaranteed at least one seat. It has been used for allotting seats in the US House of Representatives to the states.

highestAverages(parties=names(lijphart),
                votes=lijphart, 
                seats = 6, method = "hh") 
Method: Hungtinton-Hill 
Divisors: 0 1.41 2.45 3.46 ... 
ENP: 3.36 (After): 3.6 
Gallagher Index:  6.75 
 
  Party Seats %Seats
1     A     2  0.333
2     B     2  0.333
3     C     1  0.167
4     D     1  0.167

Using Thresholds

Let’s assume that we have an election with 1,000 total voters in which five parties (A, B, C, D, and E) have gained 100 (10%), 150 (15%), 300 (30%), 400 (40%), and 50 (5%) votes, respectively. In this electoral constituency, there are 3 seats up for election, and all votes cast are valid. The electoral system has a 7% vote threshold, meaning that parties must get at least 7% of the total unspoiled votes cast in order to participate in the distribution of seats. Party E would then be elimiated from competition at the outset.

If the d’Hondt method of seat allocation were employed in this hypothetical election, then party C would get 1 seat (or 33% of the number of seats), and party D 2 seats (or 67% of the seats).

const <- c("A"=100, "B"=150,"C"=300, "D"=400, "E"=50)

highestAverages(parties=names(const),
                votes=const,
                seats = 3, method = "dh",
                threshold = 7/100) 
Method: d'Hondt 
Divisors: 1 2 3 NA ... 
ENP: 3.51 (After): 1.8 
Gallagher Index:  55.1 
 
  Party Seats %Seats
1     D     2  0.667
2     C     1  0.333
3     A     0  0.000
4     B     0  0.000
5     E     0  0.000

The following example is taken from the 2015 general elections in Spain. The region of Valencia returned 15 seats allocated using the D’Hondt method in a closed list PR system. Only lists that poll at least 3% of the total vote (which includes expoiled votes “en blanco”) can be considered.

     PP Podemos    PSOE     C's      IU   PACMA  Others 
 442005  395729  275680  221299   68759   14445   35943 
# Valencia returned 15 members
highestAverages(parties=names(Valencia),
                votes=Valencia, 
                seats=15, method = "dh",
                threshold = 3/100)
Method: d'Hondt 
Divisors: 1 2 3 4 ... 
ENP: 4.37 (After): 3.57 
Gallagher Index:  6.33 
 
    Party Seats %Seats
1      PP     5  0.333
2 Podemos     5  0.333
3    PSOE     3  0.200
4     C's     2  0.133
5      IU     0  0.000
6  Others     0  0.000
7   PACMA     0  0.000

Next, the methods that divide the votes by a mathematically derived quota, such as the Droop quota, the Hare quota (or Hamilton/Vinton), and the Imperiali quota.

Largest Remainder Methods of Allocating Seats Proportionally

Highest averages methods allocate seats proportionally to the number of votes by dividing the number of votes required for each party by a quota. The quota may vary because it is the result of dividing the number of unspoiled votes (\(v\)) by some whole number close to the number of seats that would next be assigned (\(s\)). In what follows are llustrative examples of the operation of some largest remainders formulas in an eight member district with the same four parties of the previous examples.

Hare quota

The Droop quota is obtained by quota = \(\frac{v}{(s)}\).

largestRemainders(parties=names(lijphart),
                  votes=lijphart, 
                  seats = 8, method = "hare") 

Droop quota

The Droop quota is obtained by quota = \(\frac{v}{(s + 1)}+1\).

largestRemainders(parties=names(lijphart), 
                  votes=lijphart, 
                  seats = 8, method = "droop") 

Hagenbach-Bischoff

The Hagenbach-Bischoff quota is obtained by \(\frac{v}{(s + 1)}\).

largestRemainders(parties=names(lijphart),
                  votes=lijphart, 
                  seats = 8, method = "hagb") 

Imperiali quota

The Imperiali quota is obtained by \(\frac{v}{(s + 2)}\). For Italian elections during the 1950s, the quota used was a reinforced version of the quota: \(\frac{v}{(s + 3)}\).

# The 1946 Italian Constituent Assembly election results: parties and unspoilt votes

Italy = data.frame(party=c("DC", "PSIUP", "PCI", "UDN", "UQ", "PRI",
                            "BNL", "PdA", "MIS", "PCd'I", "CDR",
                           "PSd'Az", "MUI", "PCS", "PDL", "FDPR"),
                   votes=c(8101004, 4758129, 4356686, 1560638,  1211956,
                           1003007, 637328, 334748, 171201, 102393,
                           97690, 78554, 71021, 51088, 40633, 21853))
with(Italy, largestRemainders(parties=party,
                              votes=votes, seats = 556,
                              method = "imperiali.q") )

Suitable output for recycling within RMarkdown documents

The output produced by highestAveragesof() and largestRemainders() functions is of class data.frame. Which R users are already familiar with, and that makes the usage with other aplications very straightforward too. For instance, one may want to produce publishable-quality table of the output with the knitr package or graphs with ggplot2.

Let’s take the data from 2014 Brazilian legislative elections, especifically from one electoral district–the state of Ceará to compare how that caucus would look like among different apportionment methods.

# Results for the state legislative house of Ceará (2014):
Ceara <- c("PCdoB"=187906, "PDT"=326841,"PEN"=132531, "PMDB"=981096,
           "PRB"=2043217,"PSB"=15061, "PSC"=103679, "PSTU"=109830,
           "PTdoB"=213988, "PTC"=67145, "PTN"=278267)

Once the data is loaded, to produce a table with seat assignment results follows effortless, for example with kable(), pandoc.table(), xtable(), etc.

mytable = highestAverages(parties=names(Ceara), 
                          votes=Ceara,
                          seats = 42, method = "dh") 
Method: d'Hondt 
Divisors: 1 2 3 4 ... 
ENP: 3.65 (After): 3.14 
Gallagher Index:  47.01 
 
library(knitr)

kable(mytable, align=c("l","c","c"), caption="Outcome under d'Hondt")
Outcome under d’Hondt
Party Seats %Seats
PRB 21 0.500
PMDB 10 0.238
PDT 3 0.071
PTN 2 0.048
PTdoB 2 0.048
PCdoB 1 0.024
PEN 1 0.024
PSC 1 0.024
PSTU 1 0.024
PSB 0 0.000
PTC 0 0.000

Next, we produce a graph comparing three highest-averages formulas we have just computed.

out1 = highestAverages(parties=names(Ceara), votes=Ceara, 
                seats = 42, method = "dh")
## Method: d'Hondt 
## Divisors: 1 2 3 4 ... 
## ENP: 3.65 (After): 3.14 
## Gallagher Index:  47.01 
## 
out2 = highestAverages(parties=names(Ceara), votes=Ceara, 
                seats = 42, method = "imperiali") 
## Method: Imperiali 
## Divisors: 1 1.5 2 2.5 ... 
## ENP: 3.65 (After): 2.48 
## Gallagher Index:  52.15 
## 
out3 = highestAverages(parties=names(Ceara), votes=Ceara, 
                seats = 42, method = "sl")
## Method: Sainte-Laguë 
## Divisors: 1 3 5 7 ... 
## ENP: 3.65 (After): 3.74 
## Gallagher Index:  43.99 
## 
# add the method:
out1$Method = "d'Hondt"
out2$Method = "imperiali"
out3$Method = "Saint-Laguë"


data <- rbind(out1, out2, out3)

p = ggplot(data=data, aes(x=reorder(Party, -Seats), y=Seats, fill=Method)) +
    geom_bar(stat="identity",position=position_dodge()) +
   labs(x="", y="Seats")
p + scale_fill_fte() + 
  theme_fte(legend = "top") 

2014 Legislative Election in Ceará (M=42)

#2014 Federal elections, 30 seats to be returned in the state of Parana, Brazil.

PR=c("PSDB/DEM/PR/PSC/PTdoB/PP/SD/PSD/PPS"=2601709,
     "PT/PDT/PRB/PTN/PCdoB"=1109905, 
     "PSDC/PEN/PTB/PHS/PMN/PROS"=501148,
     "PV/PPL"=280767)

2014 Federal elections, 70 seats to be returned in the state of Sao Paulo, Brazil.
SP=c("PSDB/DEM/PPS"=5537630, "PT/PCdoB"=3170003,
     "PMDB/PROS/PP/PSD"=2384740, "PSOL/PSTU"=462992,
     "PSL/PTN/PMN/PTC/PTdoB"=350186, "PHS/PRP"=252205)

Indices of Political Diversity

# The 2004 presidential election in the US (vote share):

US2004 <- c("Democratic"=0.481, "Republican"=0.509, 
            "Independent"=0.0038, "Libertarian"=0.0032, 
            "Constitution"=0.0012, "Green"=0.00096,
            "Others"=0.00084)

print(US2004)
  Democratic   Republican  Independent  Libertarian Constitution 
     0.48100      0.50900      0.00380      0.00320      0.00120 
       Green       Others 
     0.00096      0.00084 
politicalDiversity(US2004); # ENEP (laakso/taagepera) method 
[1] 2.039
politicalDiversity(US2004, index= "golosov");
[1] 2.1
politicalDiversity(US2004, index= "herfindahl");
[1] 0.51

Considers the following data.frame with electoral results for the 1999 election in Helsinki, the seats were allocated using both Saint-Laguë and D’Hondt methods so we can compare the effect of the allocation formulas on the effective number of parties.

# Helsinki's 1999

Helsinki <- data.frame(
  votes = c(68885, 18343, 86448, 21982, 51587,
            27227, 8482, 7250, 365, 2734, 1925,
            475, 1693, 693, 308, 980, 560, 590, 185),
  seats.SL=c(5, 1, 6, 1, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0,
             0, 0, 0, 0, 0),
  seats.dH=c(5, 1, 7, 1, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0,
             0, 0, 0, 0, 0))
# politicalDiversity(Helsinki$votes); #ENEP Votes

politicalDiversity(Helsinki$seats.SL); #ENP for Saint-Lague
[1] 4.762
politicalDiversity(Helsinki$seats.dH); #ENP for D'Hondt
[1] 4.167

Measures of Proportionality

Let’s consider the following two real-data examples taken from the Wikipedia. These two elections refer to subnational elections, one from Queensland (AUS) and the other from Quebec (CAN).

# 2012 Queensland state elecion:
Queensland <- data.frame(party = c("LNP", "ALP", "Katter", "Greens", "Ind", "Others"),
                         votes = c(1214553,652092,282098,184147,77282,35794),
                         pvotes = c(49.65, 26.66, 11.5, 7.53, 3.16, 1.47),
                         seats = c(78, 7, 2, 0, 2, 0),
                         pseats = c(87.64, 7.87, 2.25, 0.00, 2.25, 0.00))
# 2012 Quebec provincial election:
Quebec <- data.frame(party = c("PQ", "Lib", "CAQ", "QS", "Option", "Other"),
                         pvotes = c(31.95, 31.20, 27.05, 6.03, 1.89, 1.88),
                         pseats = c(54, 50, 19, 2, 0, 0))

The Gallagher Index

with(Queensland, gallagher(pvotes, pseats))
[1] 31.16
with(Quebec, gallagher(pvotes, pseats))
[1] 21.54

The Lijphart’s Index of Proportionality

with(Queensland, lijphart(pvotes, pseats))
[1] 37.99
with(Quebec, lijphart(pvotes, pseats))
[1] 22.05

The Grofman Index

with(Queensland, grofman(pvotes, pseats))
[1] 29.43
with(Quebec, grofman(pvotes, pseats))
[1] 10.49

Farina Index

with(Queensland, farina(pvotes, pseats))
[1] 0.4559
with(Quebec, farina(pvotes, pseats))
[1] 0.3094

The Cox-Shugart measure of proportionality

with(Queensland, cox.shugart(pvotes, pseats))
[1] 1.711
with(Quebec, cox.shugart(pvotes, pseats))
[1] 1.567

The inverse Cox-Shugart measure of proportionality

with(Queensland, inv.cox.shugart(pvotes, pseats))
[1] 0.4811
with(Quebec, inv.cox.shugart(pvotes, pseats))
[1] 0.5439

Measures of Inequality and Concentration

I will write soon…

\newpage

References

Cowell, F. A. (2000) Measurement of Inequality in Atkinson, A. B. / Bourguignon, F. (Eds): Handbook of Income Distribution. Amsterdam.

Cowell, F. A. (1995) Measuring Inequality Harvester Wheatshef: Prentice Hall.

Benoit, Kenneth. (2000) “Which Electoral Formula is the Most Proportional? A New Look with New Evidence.” Political Analysis 8(4): 381-388.

Blais, A., and L. Massicotte (1997) Electoral Formulas: A Macroscopic Perspective, European Journal of Political Research, 32, 107–129.

Gallagher, Michael and Paul Mitchell (2005) The Politics of Electoral Systems. Oxford University Press.

Gallagher, Michael (1992) “Comparing Proportional Representation Electoral Systems: Quotas, Thresholds, Paradoxes and Majorities”. British Journal of Political Science, 22, 4, 469-496.

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

Golosov, Grigorii (2010) The Effective Number of Parties: A New Approach, Party Politics, 16: 171-192.

Laakso, Markku and Rein Taagepera (1979) Effective Number of Parties: A Measure with Application to West Europe, Comparative Political Studies, 12: 3-27.

Lijphart, Arend (1994) Electoral Systems and Party Systems: A Study of Twenty-Seven Democracies, 1945-1990. Oxford University Press.

Nicolau, Jairo (2008) Sistemas Eleitorais. Rio de Janeiro, FGV.

Norris, Pippa (1997) Choosing electoral systems: proportional, majoritarian and mixed systems.

Taagepera, R., and B. Grofman (2003) Mapping the indices of seats-votes disproportionality and inter-election volatility. Party Politics 9, 6: 659-77.

Taagepera, Rein and Matthew S. Shugart (1989) Seats and Votes: The Effects and Determinants of Electoral Systems. New Haven: Yale University Press.