February 20, 2017 President’s Day


They didn’t like the outcome so they accused me of manipulating the data.  My students did. Today. In my afternoon class.

 Today was President’s Day.  It was also the 30th anniversary of Ronald Reagan’s Brandenburg speech, where that forever phrase was first uttered: “Mr. Gorbachov: tear down this wall!!!”  So I had intended something apropos.

 Ronald Reagan is today remembered as one of our greatest presidents – if not the greatest, adored, and revered by many.  It is said he spoke optimistically of the future; his words were inspiring, hopeful.  Most people who remember would surely consider him unabashedly optimistic. 

 Reagan’s Brandenburg Gate speech conveyed hope to millions, inspired action, and change the face of Europe as we knew it: within two years of Reagan’s speech Gorbachov took down that wall!

 By contrast – President Trump is considered the opposite – at least by most of the students in my afternoon class: dark, negative, - and if anything, wildly pessimistic.  And since we are speaking of speeches – there is probably none as dark (so far) as President Trump’s inaugural address this past January. 

 So the task in class today was to appraise the relative optimism of the two Presidents.  We would do this by mining the text of the two speeches: both are available online Reagan here and Trump here. First scrape the sites to download the text of each speech.  And then we would submit each speech to a rigorous sentiment analysis to settle the question: Who is more positive: Trump or Reagan?

 That’s when they accused me of fudging the data.  Cause they didn’t like the answer.

 As it turns out – Trump is more positive than Reagan; albeit slightly so.  Here are the results of the sentiment analysis of the two speeches:



So, as you can see from the results, it turns out that President Trump scores a 70 (out of 100) whereas President Reagan comes in at 61.6.

 How did we arrive at this result?  The words of the two speeches are first classified as to their sentiment: positive or negative.  For the classification we relied on Professor Bing Liu’s Opinion Lexicon. The Bing lexicon contains about 6800 classified English words.  This is the same sentiment library we use to assemble the UNH Economic Sentiment Index.  However, it now comes packaged with the spectacular tidytext R package.

 So what is an instructor to do – when confronted so?  I think the data speaks for itself. 

 Although, I admit, there was some minor "tinkering" on my part. Wink. Wink. But it’s not what you think – no technical or coding messing around. So if you can spot the feature that is driving the results write to me.  I’ll share it with my students.

 Last, here are the two respective wordclouds: guess which one is which?



Email me when people comment –

You need to be a member of UNH Economics Collective to add comments!

Join UNH Economics Collective


  • Interesting! It would also be insightful to compare the their inaugural speeches do a more apples to apples comparison.
This reply was deleted.