Background: Living in Berlin, cycling through Brandenburg
Like many people in Berlin, I really enjoy occassional daytrips for hiking and cycling in Brandenburg. Tranquil lakes and forests as well as cozy cafés help me to recharge my batteries and provide a nice breakout from sometimes hectic city life. This was also our intention when me and my girlfriend went on a bicycle trip in August 2024, just between two political elections: The elections for the European Parliament in June 2024 and the elections for the Parliament of the Federal State of Brandenburg in September 2024.
Not surprisingly, many streets along our way were cluttered with elections posters from different parties. More surprisingly, however, was our observation that the posters seemed to change along the way. In particular, it struck us that the share of posters that were set up by the AfD (“Alternative für Deutschland”, a ring-wing populist and national-conservative party in Germany) increased the farther away we got from Berlin. Actually, towards the end of our bike trip we passed through some villages at the western edges of Brandenburg were the AfD was the only political party that had set up any elections posters.
This made us wonder: Is it generally the case that people living in Berlin’s surrounding countryside vote less often for the AfD than people living more faraway areas of Brandenburg? After all, people living in big cities usually vote less often for ring-wing, nationalist parties than people living in rural areas. Hence also people living close to big cities might vote less often for ring-wing, nationalist parties than people living farther away from big cities. In addition, many people moved out of Berlin in the past two decades to a larger property in Brandenburg within commuting distance. Thus, a higher share of liberal Ex-Berliners in Berlin’s surrounding countryside might also provide an explanation for less AfD posters in these communities.
But enough speculation, let’s get to the data to see whether there is any empirical evidence supporting these train of thoughts.
Data: Getting election results and municipality borders
In order to investigate the potential relationship between the share of AfD votes in Brandenburg and the distance to Berlin, we will use two main sources of data:
- The final results of the election for the European Parliament in 2024
- The borders of the municipalities in Brandenburg
The entire R-Code with all the packages needed for the data processing and the analyses can be found on Github. The first step, after installing and loading the required packages, is to retrieve the election results. You can get them on a website of the Federal State of Brandenburg.
Let’s load the data and take a look at it. The column “Gebietsart” is relevant because it allows us to select the election results on different administrative levels. The smallest administrative level available is the municipality (“Gemeinde”) which is what we go for.
The borders of the municipalities in Brandenburg can be accessed free of charge and without registration on the website Geobroker. You can save them locally and then load them into memory.
Then we added the share of votes for the AfD for each municipality to the geo-referenced municipality borders and we set the coordinate system of the municipalities to “EPSG:25833”. This allows us to plot the election results per municipality on a map: