BW #49: Campaign finance

How much money do candidates for election raise in the US? This week, we look at data from the Federal Elections Commission, shedding light how much they earned, and how much they spent.

BW #49: Campaign finance

It's 2024, and as the Economist recently pointed out in their "The World Ahead" issue, it'll be the biggest election year in history. They say that 76 countries, home to more than 4 billion people, will be going to the polls. And while not every country's elections are what we would call free and fair, this year will still involve a lot of people choosing new directions and leadership for their countries.

One of this year's biggest and most important elections will be for United States president. That election, along with many others (including 1/3 of the Senate and all of the House of Representatives) will take place on Tuesday, November 5th. American elections are always a big deal, but it looks like Joe Biden and Donald Trump will be facing off for a rematch. It's not too often that a defeated, indicted, and impeached former president tries to return to the White House, so everyone is watching this very closely.

Money plays a large role in US elections, with all sorts of rules regarding how much each person or organization can donate. Each campaign can raise money, but they can also have affiliate committees that raise money on their behalf, as well as others that are supposedly independent. I don't pretend to know the ins and outs of such things, but I am skeptical about the benefits of having so much money pouring into the political system. (Stephen Colbert, on his previous TV show, had a whole series about PACs and Super PACs that is as funny as it is instructive.)

Campaign fund-raising and spending is overseen by the Federal Elections Commission (https://www.fec.gov), a government agency that has members from both major parties and which aims to ensure campaign-finance laws are followed. (More information about the FEC is here: https://en.wikipedia.org/wiki/Federal_Election_Commission )

Things don't always work that well in practice; in recent years, the FEC seems to have been gridlocked or without a quorum for some time. Even if they don't enforce the rules, they do at least publish financial statements from campaigns. Let's see if we can better understand the numbers around campaign spending.

Data and 9 questions

This week, we'll look at the FEC's latest data on campaign spending. We'll see how much candidates have raised, whether there's a difference between state and federal elections, and other comparisons.

The data itself comes from this page:

https://www.fec.gov/data/browse-data/?tab=bulk-data

The specific candidate data we'll be looking at will be from 2023-2024, and is located here:

https://www.fec.gov/files/bulk-downloads/2024/weball24.zip

The data dictionary for this data is here:

https://www.fec.gov/campaign-finance-data/all-candidates-file-description/

I have nine questions and tasks for you this week. As always, I'll provide detailed solutions (including my Jupyter notebook) tomorrow.

The learning goals for this week include importing data from HTML tables, thinking about mean vs. median values, selecting rows and columns, grouping, and plotting -- including boxplots.

Here are my nine questions:

  • The data dictionary indicates the names (and meanings) of the columns in the actual candidate fund-raising data. Create a series containing the column names.
  • Now create a data frame based on the candidate data. Use the column names from question 1 as the column names for the data frame.