Null hypotheses
Oh well I have to write something
I know the election stuff is probably played out, and the Big Data Drop where different demographic groups are disambiguated isn’t out for some time, but I was impatient to figure something out last week.
Two anti-immigration parties did pretty well in the local elections. On Sjælland particularly, DF (Dansk folkeparti), did well and in Jylland, DD (Danmarks demokraterne) got a few politicians in to the town hall even though they’re a brand new party.
My hypothesis was
Are these parties doing better in kommuner where there are a lot of foreigners?
And spoilers in the title, but the answer is ‘no’. But this is how I found out:-
This next paragraph is a bit ‘inside baseball’ and as such skippable:-
I went on statbank and pulled the most recent breakdown of foreign/native population1 , then I did it for just working age (18-66), then I looked up how many were enfranchised foreign/native. Joined it together in one mega mix. Then I wanted the voting stats, and they are available on valg.dk’s servers. I explained to claude code that i just wanted the kommuner with parties voting percentages, and it scripted the whole process from getting dozens of jsons off the server, and combined in my exact format. I explored the data on hypothesize.io which was very rewarding but showed me that none of my hypotheses were correct.
After all that, I played around with Claude code to generate some tasty graphs instead. Here’s two. No one needs more than two on a Monday morning.
The vertical axis is the percentage of foreign voters in a kommune. The horizontal axis is the percentage of working age population from a foreign background. The dotted line would be if every foreigner of working age had the vote in local elections, the data below it are the actual kommuner and you can see that there is not much difference between kommuner about the same percentage difference of working age foreigners is disenfranchised, slightly worse in places with more foreigners. In a political context where the discussion is about removing voting rights from non-citizens it might seem like a big ask for anyone paying tax into the system to have a say about how it is run. But ok, Denmark isn’t pay-to-play, it’s more complicated than that.
I wondered if the increasing presence of foreigners depressed turn out, since younger foreigners tend not to vote so much (because they’re students or temporary workers?)
The vertical axis is all voter turnout, not depending on background because that info isn’t available yet. The horizontal axis is the percentage of working age population from a foreign background, again.
The blue dots and trend line are about Greater Copenhagen kommuner, the greenish dots and trend line is about everywhere else.
Outside of Greater Copenhagen, the greater presence of foreign working age people did not depress turnout. For Greater Copenhagen we can see that once you get past 20% working age foreigners, turnout does increasingly get depressed as the percentage increases. We won’t know why until the dataset drops in the summer. Wait, that’s presumptuous of me. We still might not know why, but we will be able to describe how a damn sight better.
You might ask, why didn’t I have ‘percentage enfranchised foreigners’ as the independent variable on the x axis there? And it’s because I wasn’t interested in ‘does having a lot of foreigners pull the turnout down because foreigner suck at democracy?’, I was curious about ‘does having a lot of foreigners in general in your community persuade all types of people to vote more or less?’ and it doesn’t look like it makes much difference in most places with fewer working age foreigners.
Looking forward to more data, need an advent calendar for that, tbh.
(folk1c, represent!!!)


