The goal of this R Markdown is to show my ability to manipulate election data using the R programming language. In the first section, I will present data from the 2024 American presidential elections. In the second part, I will show part of my work with the 1921 Italian elections.
The source for the county-level US election data is the following: https://github.com/tonmcg/US_County_Level_Election_Results_08-24 . The first picture represents the candidate that won in each US state (Nebraska and Maine are represented as one despite dividing their electors by district).
In this second picture, the vote share by the GOP is shown in each state, The color is stronger, the higher (or lower) the vote share. The shade is blue for each democratic victory and red for each republican victory.
We can also compare the performance of the candidates in the 2020 elections with the elections in 2024. How much vote share Kamala Harris lost in each state compared to Joe Biden?
Let’s represent these data in a graph.
I proceed now to show a sample map for the county level. I decided to use the data on Pennsylvania, since it was the largest key state in the presidential race. The map is interactive. Hovering over the map shows the name of the county and the difference in vote share between the democratic and the republican candidates.
This section will show outputs from a paper I wrote on the rise of fascism in Italy. The argument was that liberal Prime Minister Giovanni Giolitti filled this National Blocks list with fascist candidates when facing strong socialist opposition. We can start observing the complex parliamentary situation in Italy before the elections.
The following map shows where the fascist were included in the National Block lists.
The next map shows the vote share distribution of the socialists.
And now a graph showing the correlation between the share of fascist candidates in the liberal lists and the socialist vote share in the previous elections.
Finally, I show the output of the prediction model that tell us the likelihood for a candidate to be fascist, based on the socialist performance in the previous elections and other parameters.