seats_lr {electoral} | R Documentation |
Allocating Seats - Largest Remainders
Description
Largest remainders methods require the numbers of votes for each party to be divided by a quota representing the number of votes required for a seat (i.e. usually the total number of votes cast divided by the number of seats, or some similar formula). The result for each party will usually consist of an integer part plus a fractional remainder. Each party is first allocated a number of seats equal to their integer. This will generally leave some seats unallocated: the parties are then ranked on the basis of the fractional remainders, and the parties with the largest remainders are each allocated one additional seat until all the seats have been allocated. This gives the method its name. The quota formula for each largest remainder method is:
Hare: (sum(votes))/n_seats
Droop: (sum(votes))/(n_seats + 1) + 1
Hangenbach Bischoff: (sum(votes))/(n_seats + 1)
Imperial: (sum(votes))/(n_seats + 2)
Modified Imperial: (sum(votes))/(n_seats + 3)
Quotas & remainders:
threshold: select all parties that meet votes_i >= (sum(votes))/(2*n_seats)
quota: (sum(votes))/n_seats (only over selected parties)
In case of ties, the implemented algorithm not allocate the involved seats, and prints how many seats had been allocated and how many are in tie.
More information: https://en.wikipedia.org/wiki/Largest_remainder_method
Developed by Jorge Albuja Delgado (albuja@yahoo.com).
Usage
seats_lr(parties, votes, n_seats, method)
Arguments
parties |
vector of names of parties, must be uniques |
votes |
vector of votes, same length as parties. |
n_seats |
number of seats to be allocated (integer equal or greater 1). |
method |
string according seat allocating method: "hare", "droop", "hangenbach-bischoff", "imperial", "mod-imperial" or "quotas-remainders". |
Value
A vector of the number seats allocated for each party.
Examples
seats_lr(parties = c("A", "B", "C"),
votes = c(100, 150, 60),
n_seats = 5,
method = "hare")
seats_lr(parties = c("V", "W", "X", "Y", "Z"),
votes = c(100, 150, 60, 80, 160),
n_seats = 15,
method = "droop")