Announcing the R Election Analysis Contest

Today I am happy to announce the R Election Analysis Contest. The goal of the contest is to encourage and promote high quality reproducible research in R that focuses on elections. The winner will be featured on my blog and receive a free copy of my course Mapmaking in R with Choroplethr as well as a copy of Hadley Wickham’s book Advanced R.

Why a contest?

As I write this, the US Presidential Primary is dominating the news. What strikes me about the news is how analytical the discussion is. Major themes seem to be:

The demographics of each voting region

How different demographics are attracted to each party

How different demographics are attracted to each candidate within each party

How the above change over time

The math behind delegates and winning both primary nominations and general elections

A major interest I have is using R to verify claims that I hear in the media. I’ve been wanting to explore voting related issues in R for a while now. And when I read pieces by Julia Silge (1, 2, 3) and Duncan McIntosh (1) I see that I am not alone.

Rather than spending a week or two on my own analysis, I think that it would be better to run a contest. If the contest gets even a modest number of entries, then I will probably enjoy reading them more than I would enjoy writing my own.

How do I enter?

To be considered, your entry must:

Be published online by Saturday April 16, 2016. If you have a blog, you can publish it there. You can also use rPubs, which is free.

Leave a comment on this page with a description and link to your entry. I will personally read each entry.

Your entry must contain an analysis that is both written in R and reproducible. That is, you must write code that works and use data that other people can load. Think of yourself as both writing an analysis and teaching other people how you did it.

Winners will be announced on my blog on Monday, April 18 2016.

FAQ

Can I submit more than one analysis? Sure.

Can I analyze an election other than the 2016 US Presidential election? Sure. It can be about a past election, an election for another office, or even an election in another country.

Can I enter as a group? Sure. In the case that a group wins all members will get a free copy of Mapmaking in R with Choroplethr. But I can only afford to buy one copy of Advanced R.

Do you have any ideas for analyses to do? Yes, but I’d rather not share them. I’m certain that someone reading this has an interesting idea that I haven’t even considered. I’d rather encourage that person to publish and submit their own analysis.

this is the israeli election app. it has more stat features (bootstrapping the mandates distributions using sampling errors and user built government coalitions based on real and resampled results) than the USA one

I am an R, as well as statistics, novice, and do not have an formal accreditation other than the usual tertiary education, but have always enjoyed working with statistics and data. Recently, I’ve started exploring both R and Python on old data sets I considered trying to publish about. Anyway, here are my entries:

Chi-Square in R on by State Politics (Red/Blue) and Income (Higher/Lower):

I’ll be doing two or three additional posts, you can consider them as separate entries or the whole thing as a single entry with parts (which is probably more the way I’m thinking of it). I’m creating a new R package to give convenient access to New Zealand general election results, doing some sample analysis and a Shiny app, and hopefully will get onto some real analysis of spatial trends in voting behavior.

My second ‘entry’ is really an extension of the first, going into more detail of how the R package was built, and is at http://ellisp.github.io/blog/2016/04/04/nzelect2/ . The third and (hopefully) fourth will be more stand alone bits of analysis!

No worries Karmin, I am glad you love the post and hopefully you like some of the additional analysis I plan to do on the data.
In order to get a developer’s key point your browser over to: https://apps.twitter.com/
Create an app and plug away into you get an API_key and a secret_key. One thing to note, the documentation instructs that you set the callback URL to http://127.0.0.1:1410