Back to Community
Finding Alpha in Political Contributions: Data Processing

In the U.S., corporations often become involved in elections for public office via political campaign contributions, where a corporation donates money to a candidate's campaign. Corporations generally make these kinds of contributions through their political action committees (PACs). Though there are specific restrictions on where and how PACs can donate, many PACs make donations totaling in the millions; for example, the PAC associated with AT&T donated over $4.6 million USD in the 2016 election cycle.

There exist many views on why corporations might donate to candidates. Some political scientists take the view that corporations donate simply because they want to (for civic duty, political expression, or something similarly desirable). Meanwhile, others argue that corporations donate to gain influence over politicians.

In this investigation, we explore political campaign contributions from the latter perspective. Operating on the assumption that corporations donate in pursuit of political favor, we hypothesize that corporations who make "more" political campaign contributions perform better than one would ordinarily expect; and we expect their stock price to increase accordingly in general. Of course, this will not be true in all cases or for all corporations; but in general, we will hypothesize that more political campaign contributions are an indicator of higher-than-expected stock returns. In other words, we hypothesize that political campaign contributions are an alpha factor.

This piece is based in particular on the work of Cooper, Gulen, and Ovtchinnikov (2010), who find that corporations extending greater support for political candidates generate significantly higher future returns than one would ordinarily expect based on traditional style factors (like book-to-market ratio, firm size, momentum, etc.).

Here, we construct an alpha factor based on the findings of Cooper et al. In the notebook attached below, we transform raw data from the Federal Election Commission into a format that can be ingested by the platform's Self-Serve Data upload. Then, we analyze our factor using Alphalens, which can be found in a separate post here.

Note 1: This notebook is meant to be run locally (on your own machine). In order to run this notebook, you should clone it into your own Quantopian account, then download it as a .ipynb file. You'll need the jupyter notebook, pandas, and numpy packages to run this notebook; detailed running and installation instructions can be found in step 0 of the notebook.

Note 2: You'll probably see some strange HTML tags appearing above the cells displaying dataframes while viewing this notebook on the Quantopian platform. This is because the version of pandas used on the Quantopian platform (0.18.1) differs from the version of pandas used in this notebook (0.23.0, a more recent version). The tags should disappear when you run the notebook locally with the correct pandas version!

Loading notebook preview...
Notebook previews are currently unavailable.
Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

10 responses

Hi Lucy -

I skimmed over your section "2b. Mapping Company Name to Ticker" and I'm wondering if you've considered offering a download of historical symbols used on Quantopian? Additionally, offering the point-in-time QTradableStocksUS would aid in taking full advantage of the new Self-Serve Data API.

Also, I'm wondering if an offline daily OHLCV data set could be offered, that has been checked against the one used by Quantopian? Fundamentals?

I'm just trying to sort out how I might compute factors offline and avoid data mismatch issues.

@ Lucy -

Would it make sense to add a free political contributions data set to https://www.quantopian.com/data? I realize you are using the data as an example, but I gather it is free, public-domain data, so why not also make it easily available to the Quantopian crowd? Or maybe this is already in the works?

The other suggestions is that for such free, public-domain data sets, perhaps you could host them for download, for use in computing factors offline, for subsequent upload via the new Self-Serve Data API? It looks like you could already do this for some data sets on https://www.quantopian.com/data, such as the ones from Quandl (but maybe the Quandl terms of use wouldn't allow this kind of re-distribution?).

Interesting. There's an ETF that tries to capture a partisan slant to this phenomenon, however the MAGA etf has been lagging behind the market. That could be attributed to sector skew in companies donate to the GOP or chance. Not a large sample period yet.

Having issues producing the .csv file in jupyter.

NameErrorTraceback (most recent call last)
in ()
1 # Save data locally for ingestion into Self-Serve Data Upload
----> 2 data.to_csv('cleaned_campaign_contribs_2018.csv', index=False)

NameError: name 'data' is not defined

Hey Kerry,

Are you sure that all the cells above in the notebook are being run? All cells need to successfully finish in order for the data variable to be defined and ready. Also note that this notebook is designed to be run on your local computer, not on the Quantopian platform. Documentation and instructions are provided in the notebook.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi Delaney,

Thank you so much for clearing that up for me. I still have a lot to learn here, haha. I appreciate all your work and support in creating this awesome community and platform for us to explore.

Really happy you're enjoying it. Check out our tutorials, especially our Getting Started Tutorial if you're looking to get comfortable building models with our tools. Check out our lectures if you want more of a theoretical explanation of quant finance. Send us a message at [email protected] if anything is unclear or you think our tutorials and lectures could be better.

Also, check out our Youtube channel for a bunch of educational content if you prefer videos/audio.

Hello Lucy,

Could you tell me where I can get the file "cm00.txt" and the others ? You've commented "# Import PAC data from 2000-2018" but I don't know where it is.

Regards,

Hi taro,

The file can be found in the FEC bulk data download under the "Committee master" section. cm00.txt would be the 1999-2000 data, cm02.txt would be the 2001-2002 data, etc.

Hi Lucy,
Thank you!!