Election Data Lab · Methodology
How we measure: the Election Data Lab's methodology
Every figure in the Lab is computed in code from the Election Commission of India's own result files; none is typed by hand. This page gives each measure's definition and formula, and works it through on one small invented example.
Election Commission files as read on 28 November 2026 · Our standards for political coverage · हिन्दी में पढ़ें
The rules of the counting
- Vote share: a vote share printed in a table is a share of all valid votes, NOTA included. That is the denominator of the Commission's own tables for 2017 and 2022 (2012 had no NOTA), and of the seat pages.
- Indices: the effective number of parties and the Gallagher, Loosemore-Hanby and Pedersen indices are computed on the votes polled for candidates. NOTA cannot win a seat, so it is left out.
- Independents: independents are not one party. In the effective number of parties and the two votes-into-seats indices, each independent candidate is an entry of their own. In volatility all independents are one group, because an independent at one election cannot be matched to one at the next.
- Every party the same way: the same table, the same columns and the same colour rule for every party. A party is named as the Commission's list of parties names it.
- Rounding: nothing is rounded in the arithmetic; percentages and indices are shown to two decimals when printed.
The worked example: an invented election
Take an invented election with four parties (A, B, C, D) and 100 seats. At the next election D does not stand and a new party, E, does. These are not the figures of any real election.
One seat, as an example: four candidates poll 50,000, 40,000, 8,000, 2,000 votes and NOTA 1,000; the seat has 1,50,000 electors and 1,01,200 voted. The candidates' valid votes add up to 1,00,000 and the votes counted, NOTA included, to 1,01,000.
| Party | Votes | Vote share | Seats | Seat share | Vote share at the next election |
|---|---|---|---|---|---|
| A | 45,000 | 45.00% | 60 | 60.00% | 40.00% |
| B | 30,000 | 30.00% | 30 | 30.00% | 28.00% |
| C | 15,000 | 15.00% | 8 | 8.00% | 12.00% |
| D | 10,000 | 10.00% | 2 | 2.00% | 0.00% |
| E | 0 | 0.00% | 0 | 0.00% | 20.00% |
The measures
Effective number of parties (Laakso-Taagepera)
Formula
N = 1 / Σ pᵢ²
pᵢ is each party's share as a fraction (of votes, or of seats). The result is the number of equal-sized parties that would give the same spread. Two equal parties give 2; the larger one party is, the lower the number.
Example: By votes 3.08; by seats 2.19.
Effective number of candidates in a seat
Formula
N = 1 / Σ cᵢ²
The same formula on one seat's candidates: cᵢ is each candidate's share of the votes polled for candidates. A straight, even fight between two candidates gives a figure near 2.
Example: In the example seat, 2.40.
Gallagher least-squares index
Formula
LSq = √( ½ × Σ (Vᵢ − Sᵢ)² )
Square each party's gap between vote share and seat share, add them, halve the sum and take the square root. Zero means seats were shared exactly as votes were; large gaps weigh more than small ones.
Example: In the example, 13.00.
Loosemore-Hanby index
Formula
D = ½ × Σ |Vᵢ − Sᵢ|
Add every party's gap between vote share and seat share, ignoring the sign, and halve it: the share of seats that would have to change hands for seats to match votes.
Example: In the example, 15.00.
Pedersen index of volatility
Formula
V = ½ × Σ |pᵢ,ₜ − pᵢ,ₜ₋₁|
Add the change in every party's vote share between two elections, ignoring the sign, and halve it. A party present at only one of the two elections has a share of zero at the other, so its whole share counts as change.
Example: In the example the whole of D's share and the whole of E's share are change; the index is 20.00.
Margin as a share of the votes counted
Formula
M = 100 × (votes₁ − votes₂) / votes counted
The winner's votes less the runner-up's, as a share of the votes counted in the seat for candidates and NOTA.
Example: In the example seat, 9.90%.
Turnout
Formula
T = 100 × voters / electors
Voters (EVM voters and postal ballots received) as a share of electors, as the Commission's Constituency Data Summary gives them.
Example: In the example seat, 67.47%.
A party's swing in a seat
Formula
swing = share at the later election − share at the earlier election
The party's vote share at the later election less its share at the earlier one, in percentage points. A party that did not stand has zero votes.
Example: In the example seat the second party polls 46,000 of 1,00,000 votes counted at the next election: a swing of +6.40 points.
Deposits lost (the one-sixth rule)
Formula
lost if not elected and votes × 6 ≤ valid votes polled by all candidates
Section 158 of the Representation of the People Act, 1951: a candidate who is not elected and polls not more than one-sixth of the valid votes polled by all the candidates loses the deposit. NOTA is not a candidate, so its votes are not in that total.
Example: In the example seat one-sixth is just above 16,666 votes; 2 candidates are below it and lose the deposit.
This is a count from the votes, not the Returning Officer's order. The Commission prints forfeited deposits in its Performance of Political Parties table; for Uttar Pradesh in 2012, 2017 and 2022 our count is tested against that figure for every party, and the page shows the Commission's figure beside it.
Matching parties across two elections
To measure volatility, two elections' parties are matched by the name in the Commission's list of parties, not by abbreviation, because abbreviations change. Two entries are the same party if their names are equal once capitals, spaces and punctuation are removed; or if the abbreviation is identical and the spelling of the name differs by no more than 2 letters.
In the Uttar Pradesh files the Commission changed the abbreviation of these parties: Adarsh Samaj Party (ASP in 2012, ADRSP in 2017); Asankhya Samaj Party (Aa S P in 2012, ASSP in 2017); Rashtriya Jan Adhikar Party (RJAP in 2012, RAJADP in 2017); Communist Party of India (Marxist) (CPM in 2017, CPI(M) in 2022). In 32 more cases only the capital letters changed. The 2012 list gives one abbreviation to two parties; the detailed results do not tell them apart, so the two are counted together.
Nothing else is merged. A party that split, merged into another or registered under a new name is a different party to the Commission and is counted as one here.
What uniform swing is, and is not
Uniform swing is a piece of arithmetic: suppose a party's vote share changes by some points across the State, and add that same change to the party's last vote share in every seat. Then see who would be ahead in each seat.
It is arithmetic on past results, not a forecast. In a real election the change is not the same in every seat; candidates, alliances, new parties and turnout change, and no party stands everywhere. The swing calculator does not say who will win; it only shows how many seats a given number of points was worth on the last result.
Map credits
- The Uttar Pradesh map. Assembly constituency boundaries: DataMeet India community, CC BY 2.5 India. The boundaries are for display; the legal boundary is the Delimitation Order's. DataMeet India community: assembly constituencies CC BY 2.5 India
- The Lok Sabha hexagon map: a layout built by Oquilia in which every Lok Sabha seat is one cell of equal size. It is not a geographic map: the cells' positions only roughly follow where the States are.
Limits
- Party codes change: the Commission prints one party under different abbreviations at different elections. Parties are therefore matched by name; a party whose name itself changed is counted as a different party.
- Alliances are not recorded: the Commission's files give each candidate's party, not a pre-election alliance. A party that stood in only some seats under an alliance has a statewide vote share made of those seats alone, and its change between two elections also reflects how seats were shared out.
- Turnout in 2017: the 2017 Constituency Data Summary does not give the voters of 11 seats. Those seats are left out of the 2017 turnout figures; their votes and electors come from the detailed results.
- By-elections are not included: every figure is a general election's.
- Differences between the Commission's own files: in a few seats two of the Commission's files differ by a vote or two. Which figure is used is recorded in our source notes. The Commission says these reports are prepared from Index Cards; where they differ, the Returning Officers' statutory forms prevail.
- Nothing about voters: the result files do not say who voted for whom. A seat's category (general, SC, ST) is the Commission's and is shown only as a count.
The Election Commission files
The Lab's Uttar Pradesh pages are built from these files. Each was taken from the Commission's site; its date and SHA-256 are kept in our records, so anyone can recompute the same figures from the same file. Other pages list their own files on the page.
- 10-Detailed Results.xlsx (28 November 2026)
- 5-Performance of Political Parties.xlsx (28 November 2026)
- 3-List Of Political Parties Participated.xlsx (28 November 2026)
- 8-Constituency Data Summery Report.xlsx (28 November 2026)
- 2-List of Successful Candidates.xlsx (28 November 2026)
- Detailed Results.xlsx (28 November 2026)
- Performance of Poltical Parties.xlsx (28 November 2026)
- List Of Political Parties Participated.xlsx (28 November 2026)
- Constituency Data Summry.xlsx (28 November 2026)
- Constituency Data Summry.pdf (28 November 2026)
- List of Successful Candidates.xlsx (28 November 2026)
- 2012.pdf (28 November 2026)
- election-result?category_id=1 (28 November 2026)
- 34-Details-Of-Assembly-Segment-Of-PC.xls (28 November 2026)
- 15-Assembly-SegmentWise-Information-Electors.xls (28 November 2026)
- 18-Party-Wise-Seat-Won-&-Valid-Votes-Polled-in-Each-State20241225122257.xls (28 November 2026)
- 3-List-Of-Political-Parties-Participated.xlsx (28 November 2026)
- 33-Constituency-Wise-Detailed-Result.xls (28 November 2026)
- constituencies?stateCode=S24 (28 November 2026)
- S24 (28 November 2026)
Corrections
If a figure, formula or definition here is wrong, write to editor@oquilia.com with the correcting document: we correct it and say so on this page.