This coming US election will prove historic for many reasons, not least of which being that whoever the next president is, they will be significantly older than Barack Obama. For me this has sprouted the idea that perhaps a correlation can be drawn between a president’s political party and their age. Namely, when voters oust one party in favour of the other, is there a trend towards older Republicans/younger Democrats?
This could be determined by a quick Googling, but since I primarily develop against an Oracle database in my day job, I see this nail as begging for the SQL hammer. Doing this in a full Oracle install is a bit of overkill, though, so I went with SQLite for this task. You can all play along at home in SQL Fiddle, or you could just skip ahead to the pretty pictures at the end of this post.
So, let’s start by creating a table to hold our data.
I fully admit that this entire exercise may just be a justification for making that “PresAge” pun in the table name.
We can obtain our data from the List of Presidents of the United States by age on Wikipedia. I didn’t include the full list, since president #13 belonged to a party (Whig) that doesn’t exist anymore. This still leaves us with ~150 years of Republican/Democrat contests, more than enough to draw some facile conclusions from.
After copying that table into LibreOffice to filter out just the relevant columns, and some regex and multi-cursor business in Atom, we have our sample data. The only thing missing is party affiliation, which is simple enough to add manually.
Note that I left the ages in an essentially base-365 representation. Since all we’re doing with these numbers is comparing them against each other, this will work just fine.
Since we’ll be querying twice (once for Democrats succeeding Republicans, and once for Republicans succeeding Democrats), let’s create a view that does most of the work.
At this point I actually missed Oracle. With no support for analytic functions in SQLite, this query required some convoluted joins and grouping in the
party_changes views. Using Oracle’s
LEAD functions would have let us write a much simpler query:
Anyway, enough jibber jabber, let’s run some queries and see what we can see.
This gives us the following results for newly elected Republicans.
|Ulysses S. Grant
|Warren G. Harding
|Dwight D. Eisenhower
|George W. Bush
And this for incoming Democrats.
|Franklin D. Roosevelt
|John F. Kennedy
This does seem to indicate a trend towards older-Republicans/younger-Democrats, particularly in more recent times.
But what about this coming election? Since I’m only looking at party switches, the Democratic chart will remain the same no matter what the outcome. So let’s look at the effect a potential Trump presidency would have.
At 70 years, 220 days old, Donald Trump would not only be the oldest incoming US president (besting Reagan by over 6 months), he would also provide us with the largest party-switch age differential at 23.05.