CITIC

El investigador Sergio Prieto desarrolla un modelo capaz de estimar la transferencia de votos en elecciones consecutivas

26/07/2023 - CITIC

Researcher Sergio Prieto García has developed a mathematical model for his Master’s Thesis in Statistical Techniques that could become a valuable tool for political parties during election campaigns. Supervised by Ricardo Cao, Professor of Statistics at the University of A Coruña (UDC), the project—titled “Estimation in Contingency Tables with Given Margins”—proposes a method to estimate the probabilities of vote transfers between political parties across two consecutive elections.

Traditionally, the Spanish Centre for Sociological Research (CIS) has conducted surveys to estimate vote transfer percentages between parties at the national level. According to Prieto, such surveys can indeed yield reliable nationwide estimates of voter behavior. However, he notes that “it’s very difficult to analyze vote transfers at the municipal or regional level using only survey responses.” With this new tool, it would be possible to quickly analyze how votes have shifted in each municipality in Spain, using only raw data from individual polling stations—that is, the vote counts for each party at each station.

Prieto’s model is based on the expectation-maximization (EM) algorithm, which processes voting data through contingency tables. The results for each party are input into an Excel file where one contingency table is created for each polling station. The algorithm is then applied to generate a final table showing the estimated probabilities of vote transfers between one election and the next. “These data can help political parties understand where they’ve gained or lost voters and make decisions accordingly,” the young researcher explains.

This approach is both faster and more accurate, as it relies on actual polling station data instead of surveys—a method that typically requires several weeks to produce results. In contrast, the algorithm yields estimates almost instantly. Moreover, it offers greater reliability, since survey results depend on whether voters choose to respond—and whether their responses are truthful.

Prieto also highlights that the usefulness of this method extends beyond the electoral field. He notes that it could be applied to analyze human behavior in various contexts, such as markets, social and behavioral sciences, or public health. In the latter, contingency tables could be used to study the relationship between different risk factors and the onset of diseases.

The full project, including a detailed report and the R code used, is available on Sergio Prieto García’s personal GitHub repository.

This table represents the transfer of votes between political options in the municipal elections held in A Coruña in 2019 and the municipal elections also held in A Coruña in 2023. Each row corresponds to a party from the 2019 elections, while the columns represent the 2023 parties. Each cell indicates how votes were transferred from one election to the other. For example, in the first cell—corresponding to PSOE in both rows and columns—the value of 56.33% represents the estimated percentage of voters who remained loyal to PSOE in both elections.