Template talk:Gallagher index

Latest comment: 11 months ago by Braganza in topic Votes & Seats

Votes & Seats edit

How about that this template can also calculate the percentages out of the seats and votes?

Template:Election results can this too Braganza (talk) 18:08, 4 June 2023 (UTC)Reply

@Kermanbob: Braganza (talk) 18:08, 4 June 2023 (UTC)Reply
@Number 57: since you were involved in the other template Braganza (talk) 13:34, 6 June 2023 (UTC)Reply
How are you envisaging using this template? Cheers, Number 57 16:46, 6 June 2023 (UTC)Reply
{{Election results}}
PartyVotes%Seats
Monegasque National Union72,60289.6324
New Ideas for Monaco8,40110.370
Total81,003100.0024
How its currently done
Gallagher Index for the 2023 Monegasque general election
Party Votes (%) Seats (%) Difference Difference
squared
Monegasque National Union 89.63% 100.00% 10.37 107.5369
New Ideas for Monaco 10.37% 0.00% -10.37 107.5369
Total of differences squared 215.0738
Total / 2 107.5369
Square root of (Total / 2): Gallagher Index result 10.37
The Gallagher Index ranges from 0 to 100. Low indexes (close to 0)
are very proportionate, high indexes (20 or greater) are very disproportionate.


How I imagine it
Gallagher Index for the {{{election}}}
Party Votes (%) Seats (%) Difference Difference
squared
Monegasque National Union 72,602.00% 24.00% -72578 5267566084
New Ideas for Monaco 8,401.00% 0.00% -8401 70576801
Total of differences squared 5338142885
Total / 2 2669071442.5
Square root of (Total / 2): Gallagher Index result 51663.06
The Gallagher Index ranges from 0 to 100. Low indexes (close to 0)
are very proportionate, high indexes (20 or greater) are very disproportionate.


Maybe with an option were you can decide if you want to use percentages as before or votes like in Election results (like "|type="). Also the "|election=" could remain but should be optional.

@Number 57: Braganza (talk) 05:59, 7 June 2023 (UTC)Reply