Description Usage Arguments Details Value Author(s) References See Also Examples
Computes the highest averages method for a variety of formulas of allocating seats proportionally.
1 2 3 4 5 6 7 8 | HighestAverages(parties = NULL, votes = NULL, seats = NULL,
method = c("dh", "sl", "msl", "danish", "hsl", "hh", "imperiali", "wb",
"jef", "ad", "hb"), threshold = 0, ...)
## Default S3 method:
HighestAverages(parties = NULL, votes = NULL,
seats = NULL, method = c("dh", "sl", "msl", "danish", "hsl", "hh",
"imperiali", "wb", "jef", "ad", "hb"), threshold = 0, ...)
|
parties |
A character vector for parties labels or candidates in the same order as |
votes |
A numeric vector for the number of formal votes received by each party or candidate. |
seats |
The number of seats to be filled (scalar or vector). |
method |
A character name for the method to be used. See details. |
threshold |
A numeric value between (0~1). Default is set to 0. |
... |
Additional arguements (currently ignored) |
The following methods are available:
"dh"d'Hondt method
"sl"Sainte-Lague method
"msl"Modified Sainte-Lague method
"danish"Danish modified Sainte-Lague method
"hsl"Hungarian modified Sainte-Lague method
"imperiali"The Italian Imperiali (not to be confused with the Imperiali Quota, which is a Largest remainder method)
"hh"Huntington-Hill method
"wb"Webster's method
"jef"Jefferson's method
"ad"Adams's method
"hb"Hagenbach-Bischoff method
A data.frame
of length parties
containing apportioned integers (seats) summing to seats
.
Daniel Marcelino, dmarcelino@live.com.
Gallagher, Michael (1992). "Comparing Proportional Representation Electoral Systems: Quotas, Thresholds, Paradoxes and Majorities". British Journal of Political Science, 22, 4, 469-496.
Lijphart, Arend (1994). Electoral Systems and Party Systems: A Study of Twenty-Seven Democracies, 1945-1990. Oxford University Press.
LargestRemainders
, Proportionality
, PoliticalDiversity
. For more details see the Indices vignette: vignette('Indices', package = 'SciencesPo')
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Results for the state legislative house of Ceara (2014):
votes <- c(187906, 326841, 132531, 981096, 2043217, 15061, 103679,109830, 213988, 67145, 278267)
parties <- c("PCdoB", "PDT", "PEN", "PMDB", "PRB", "PSB", "PSC", "PSTU", "PTdoB", "PTC", "PTN")
HighestAverages(parties, votes, seats = 42, method = "dh")
# Let's create a data.frame with typical election results
# with the following parties and votes to return 10 seats:
my_election_data <- data.frame(
party=c("Yellow", "White", "Red", "Green", "Blue", "Pink"),
votes=c(47000, 16000, 15900, 12000, 6000, 3100))
HighestAverages(my_election_data$party,
my_election_data$votes,
seats = 10,
method="dh")
# How this compares to the Sainte-Lague Method
(dat= HighestAverages(my_election_data$party,
my_election_data$votes,
seats = 10,
method="sl"))
# Plot it
# Barplot(data=dat, "Party", "Seats") +
# theme_fte()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.