Hm, somehow my posting got returned and. Hence, I send it again, hopefully
that will not be a double posting.
GT
_____________________
Hi!!
My topic is not so much a specific or technical question, but a full-scale
request for help. I already did a quick and dirty solution working with
many dummy variables. Unfortunately, it turned out to be neither elegant
nor "quick".
My problem: I would like to program a vote --> seat conversion in electoral
systems applying the d'Hondt formula. Hence, in my dataset each observation
consists of the absolute number of votes for each party i (v1, v2, v3, ...,
vi) and I want to obtain the respective number of seats (m1, m2, m3, ...,
mi). The d'Hondt highest averages method, applied in an electoral district
returning m seats, works as follows: The absolute vote numbers are divided
by a sequence of integers which, in case of d'Hondt, is simply 1,2,3,...,
and the m seats are sequentially awarded to the parties with the highest
averages.
In this example, the first seat is awarded to party 1 (receiving 41000
votes), the second to party 2 (receiving 29000) votes, the third again to
party 1 (for 41000/2=20500 votes) and so on.
My quick and dirty solution deals with lots of dummy variables, and is for
that reason pretty slow. I suppose some sort of matrix programming would do
much better, but I was not able to program it.
Any ideas? Any help would be greatly appreciated!!