Let's Analyze Trump's Tweets

Since Trump became the US president, many people have noticed that he posts a lot of tweets. While some people choose to analyze and critique the content of those tweets, I was more curious about something a little less controversial -- the timing and quantity. Follow along as I dig into some twitter data, and find the best way to visually analyze it!

But first, speaking of "tweets," here's a picture of my friend Danielle's favorite tweeter. Thanks for letting me use your picture, Danielle!

As I was looking into this topic, I came across a related graph on reddit. This pointed me to the data I would need, and served as a good starting point.

In my version (below, and click through here to see the full-sized interactive version), I decided to make a few changes.

  • Rather than using a 3-color gradient, I used a single color with transparency. That way, when multiple tweets lined up in nearly the same spot in the graph, the colors would combine and make a darker shade.
  • I added a note indicating when the data snapshot was taken (Nov 30, 2017).
  • I added time labels along the right-hand-side axis tick marks.
  • I include a blank space for December in the axis, making it more evident that this data does not include December tweets.
  • I left off the 'Time' label on the Y-axis (I think people will know that these are 'time' values).
  • I added 'Noon' and 'Midnight' labels on the time axis, to help prevent confusion between 12pm and 12am.
  • I use reference lines between the months, instead of in the middle of the months.

While importing the data, I noticed that there were actually tweets available for quite a few years, and thought it might be interesting to also plot the previous years' data. The original author also went down this path, posting the following graph in a follow-up comment on the reddit thread. But his new graph had several problems. Why didn't the "High Tweet Density" colors in this graph match up with the colors used in the previous graph? (Has the definition of "High" changed?) And the tick marks & labels along the bottom axis are poorly chosen (looks like he let it auto-scale, and didn't include the year in the labels, which makes them very confusing).

In my version (below, and click through here to see the full interactive version), I label the bottom axis by year, and add reference lines between each year. I also go back to 2009, rather than just 2013 (if you're going to show a historical graph, why not go back as far as you have data, eh?)

Looks like Trump's tweeting habits have varied over the years - can you correlate any events, or maybe his "job changes" with the density of his tweets? Or perhaps he changed the type of phone he was using in early 2013? I wonder if he was using an automated system to tweet during the night, in the 2013/2014/2015 time period? Perhaps he had employees tweeting for him?

It was a big surprise to me that it appears Trump has actually been tweeting less since he became president! What interesting things do you see in these graphs?

[This blog originally appeared on SAS Learning Post, and you can read the original there.]

Robert Allison, The Graph Guy!, SAS

Robert Allison has worked at SAS for more than 20 years and is perhaps the foremost expert in creating custom graphs using SAS/GRAPH. His educational background is in computer science, and he holds a BS, MS, and PhD from North Carolina State University. He is the author of several conference papers, has won a few graphic competitions, and has written a book calledSAS/GRAPH: Beyond the Basics.

What's the Most Likely Location for Amazon's HQ2?

Where should Amazon locate its second headquarters? CNBC put together a report card rating several locations. Here's an improved data visualization of that scoring.

Does Your Dashboard Measure Up?

What does the ideal dashboard look like? Here's a deep dive into what works and what doesn't in dashboards.

Mental Health
  • 12/7/2017 2:20:02 PM

I wonder if you can assess mental health from tweets? Many of the tweets are not rational, but that could be a plan.

Re: Tweeter-in-Chief
  • 12/7/2017 10:51:50 AM

@Lyndon, I agree.

Re: Tweeter-in-Chief
  • 12/6/2017 4:43:21 PM

<Maybe this suggests that the demands of the office are a lot heavier than whatever he was involved with in the past?> @Lyndon_Henry that makes sense, especially in light of the fact that he still has a hand in his business operations.

  • 12/6/2017 4:30:42 PM

So far I can discern virtually nothing of great significance regarding Trump's Twitter activity. From early 2016, when the campaign was starting to really heat up, Trump seems to have slacked off the heavy Twittering in the 2-5 AM period ... maybe acceding to demands from his campaign handlers (or his own fatigue) to get more sleep? Since assuming the duties of office in 2017, his heaviest activity seems to be concentrated in the 6-9 AM period, while substantially "lightening up" the rest of the day. Maybe this suggests that the demands of the office are a lot heavier than whatever he was involved with in the past?

  • 12/6/2017 1:18:20 PM

I don't follow his Twitter account, though I do often see his tweets quoted in accounts I do follow. They are split between those who like them and those who are aghast at them, with the majority tilted toward the latter category. Accordingly, if as president he is tweeting less, that is good. But I'm not surprised that he is. I think he used social media as a direct marketing tool very effectively in getting elected, and he doesn't have to do that in the same way at present.

<<   <   Page 2 / 2