Data Processing Methodology
Philippine Senate election results, 2007–2025
0. Overview
This dataset combines Senate election results from seven election years (2007, 2010, 2013, 2016, 2019, 2022, 2025) into a single, consistent dataset showing vote counts per candidate per city or municipality. Each year's source file was released in a different format. The steps below describe how these were standardized, corrected, verified, and combined.
1. Source data
Seven files, one per election year, obtained as Excel or CSV spreadsheets. Each file lists municipalities in rows and candidates in columns, with vote counts in the cells. Formats differed by year: column names, file type, number of extra columns, and how missing or special entries were recorded were not consistent across files.
Provenance also differed by year:
- 2022 and 2025 — Publicly available official results.
- 2019 and 2016 — Manually scraped from source.
- 2013 and 2007 — Sourced from NAMFREL archives. These were already tabulated but required manual cleaning before use.
- 2010 — Sourced from COMELEC archives.
2. Standardizing the format
Every file was converted from its original "wide" layout (one column per candidate) into a single, uniform structure: one row per candidate, per municipality, per year, with the vote count. This produces one consistent format across all seven years regardless of how many candidates ran in a given year, and allows the years to be combined directly.
3. Removing non-vote data
Each file was checked for columns or rows that were not vote counts before combining, since including them would have inflated totals. The following were identified and removed:
- 2007 — A block of columns summarizing the top winners was present alongside the actual per-candidate columns. Removed to prevent double-counting.
- 2013— Alongside each candidate's vote count was a second column showing that candidate's rank in the municipality (a small ranking number, not a vote total). Rank columns were removed; only vote columns were retained.
- 2016— A row labeled "TOTAL," summarizing the entire country's results in a single line, was present in the file. This row was excluded, as including it would have duplicated the national vote count.
- 2022 and 2025 — Redundant text columns repeating municipality names, and percentage columns, were identified and removed.
Row and column counts were checked against expected totals after each removal to confirm no vote data was lost or duplicated in the process.
4. Correcting a missing location code
One municipality, in Lanao del Sur, was missing its official location code in the 2007 and 2016 files, which would have excluded it from geographic analysis. Investigation identified that this municipality had been officially renamed (from "Bumbaran" to "Amai Manabilang"); the earlier files used the former name, which no longer matched the current official location registry. The correct location code was applied manually to this municipality's records in both years, based on the current official registry (PSGC).
Genuine overseas absentee voting (OAV) records within the 2016 file were identified separately (17 entries, one per country/post) and kept in a separate dataset, since they do not correspond to a Philippine municipality.
5. Resolving candidate name inconsistencies
Candidate names were not recorded consistently across years. The same individual could appear under different formats, for example:
- "Drilon, Franklin M." in one year, "Drilon, Frank" in another
- "Osmeña, Sergio III D." in one year, "Osmena, Sergio III" in another
- "Pacquiao, Manny" in one year, "Pacquiao, Manny Pacman" in another
Without correction, each name variation would be treated as a separate individual, fragmenting one candidate's record across years. A reference table was built mapping each name variation found in the source files to one standardized identity per candidate. Each mapping was verified against public sources before being applied.
Cases involving genuinely different people with similar names were also identified and kept separate, for example: "Enrile, Juan Ponce Jr." and "Enrile, Juan Ponce Sr." (father and son, both candidates in different years). A dedicated check was run across the full dataset to identify any remaining cases where the same person may have been split into more than one record, since this type of error is not otherwise visible without directly checking for it.
6. Verification
- No negative vote counts were present.
- Total votes, number of candidates, and number of municipalities were reviewed for each year to identify any unexpected increase or decrease.
- The highest vote totals were checked against known candidates and major cities, to confirm results were consistent with expectations.
- The final combined row count was confirmed to match the expected count after removing non-vote rows, with no unexplained gain or loss of records.
7. Final data structure
The verified dataset was reorganized into three linked tables to reduce file size and repetition:
- A table of municipalities (location codes and names).
- A table of candidates (standardized identity per candidate).
- A table of vote records (year, municipality, candidate, and vote count), referencing the two tables above rather than repeating names on every row.
This reduced the dataset's file size substantially while preserving all original information. A single, non-restructured version of the full dataset is also retained for reference and audit purposes.
8. Status
All seven years are integrated using this process. A small number of candidate name mappings remain under final review. Future election years will be incorporated following the same procedure to maintain consistency.
Frequently asked questions
Is this official COMELEC data?
No. This is an independent, unofficial project, not affiliated with or verified by COMELEC. The dataset was compiled municipality by municipality from individually sourced files, and results from some municipalities are missing, so rankings, tallies, and vote counts shown can diverge from official COMELEC results.
Which election years are covered?
Seven Philippine senatorial election years: 2007, 2010, 2013, 2016, 2019, 2022, and 2025, each broken down to the municipality level.
Where did the source data come from?
2022 and 2025 results come from publicly available official results. 2019 and 2016 were manually scraped from source. 2013 and 2007 were sourced from NAMFREL archives. 2010 was sourced from COMELEC archives.
Why might a candidate’s numbers here differ from other sources?
Some municipalities are missing from the underlying source files. Where a municipality is missing, its votes are absent from every total, rank, and vote share computed from this dataset, including national and provincial figures, so outcomes shown can diverge from the official count.
Rankings and totals will not match official results
The rankings, tallies, and vote counts shown here do not correspond exactly to official COMELEC results. This dataset was painstakingly compiled municipality by municipality from individually sourced files rather than a single authoritative feed, and results from some municipalities are missing. Where a municipality is missing, its votes are absent from every total, rank, and vote share computed from this dataset — national and provincial figures included — so outcomes shown here can diverge from the official count. This is an independent, unofficial project, not affiliated with or verified by COMELEC. If a number looks wrong, treat it as a reason to verify against COMELEC's official results, not as certain.