How Does News Coverage Differ Between Media Outlets?
By: Michael Tauberg
Tags: Media, Data Science, News, Data Journalism, Journalism

How Does News Coverage Differ Between Media Outlets?

A comparative analysis of news media over the last month using R and Python

In the past year, it seems like political news has become more divisive and more biased¹. As President Trump rails against tech companies for not promoting news sources equally², I wondered, is there a measurable difference in the news these days?

Luckily there is a fantastic python library that can be used to scrape news sites, so we can begin to answer that question. Using Newspaper³, I was able to grab the main headlines from multiple media outlets over the last month. Writing some simple scripts to collect and analyze the news data, I was able to get a sense of how their coverage diverges.

The Focus of the News

One fun way to see patterns in text data is to generate word clouds. R provides some simple text mining libraries (tm, wordcloud, and SnowballC) that make generating wordclouds a breeze. For a great resource on this topic, see this tutorial⁴.

After I removed the obvious English stopwords from the data (‘the’, ‘a’, etc) as well as some news-specific ones (‘link’, ‘video’, etc), I saw obvious patterns.

Mainstream news sites are all about ‘trump’

In 2018, it’s no surprise that the mainstream news is dominated by ‘Trump’.

Nevertheless, I also wanted to see what less popular media outlets were reporting. To do so I picked a sampling of sources from across the political spectrum. Although the secondary areas of interest differ across these sources, each one focussed most on the president.

Finally, I grabbed data from two international news sites — the BBC and the Guardian, to see if the emphasis on president Trump was as strong across the globe.

Thankfully, it seems that global news has a broader array of concerns than just Donald Trump.

Top Words in News Headlines

Another useful tool to detect the most common terms in a corpus of text data is the R “TermDocumentMatrix” function. It tells us the frequency of each word in a collection of text⁵. Using this information, it’s easy to plot the most common words from each news source. Below I plot the 5 most common words in the headlines of MSNBC, CNN, and Fox News.

It’s clear that CNN and MSNBC are almost entirely devoted to President Trump and his scandals, with ‘Trump’, ‘Cohen’, ‘Mueller’, and ‘Manafort’ being the top terms. On Fox, ‘Trump’ is still number one by a wide margin, but the other stories are more generic (ie. ‘man’, ‘woman’, ‘report’, ‘police’).

For fun, here are the top words in headlines from the other sites as well.

Simple Analysis of Headlines Sentiment

The news always tends to have a negative bias. In these tumultuous times, where some people claim we are living in a new dark age, I wanted to see how negative these headlines really are.

One simple way to measure the sentiment of text is to use a sentiment lexicon, or a dictionary where each word has a positivity score associated with it. I chose to use the popular AFINN⁶ lexicon which rates words on a scale of -5 to +5. For example, in this corpus, words like “worried” have a score of -3 and words like “great” have a score of +3.

By averaging the sentiment scores of the words associated with each new site, I was able to get a picture of how positive or negative they seemed.

Surprisingly, the Washington Post proved to be the most negative news source using this method. I guess the company whose new motto is “democracy dies in darkness” doesn’t mince words.

Sentiment Analysis using Sentimentr Library

One flaw of naively measuring sentiment solely using words scores is that this method ignores the context of a sentence. Using this approach, a sentence like “this pizza is not bad”, will only register the word ‘bad’ and not the valence shifter ‘not’ in front of it. Luckily the SentimentR⁷ library takes into account these valence shifters and allows us to measure sentiment at the unit of sentences.

Using this library to compare the positivity/negativity of the headlines themselves, I got the following plot.

Once again, the Washington Post is the most negative by a wide margin, beating out even more radical sites like Breitbart and Infowars. The rest of the news sources are all about the same and all slightly negative.

Conclusions

In this era of “fake news”, the idea of political objectivity seems more distant than ever before. Nevertheless, with a data-driven approach, we may be able to get a more neutral look at what is being presented to us in the media. As I’ve shown, gathering news data is incredibly easy. I’d encourage anybody with a little bit of time to see how their favorite news outlet measures up and to make sure that they are really getting a comprehensive representation of our shared reality.

Notes

All code and data used for this article is online at https://github.com/taubergm/NewsHeadlines

1 — A fun study on media bias — http://www.niemanlab.org/2018/06/democrats-see-most-news-outlets-as-unbiased-republicans-think-theyre-almost-all-biased/

2 — https://gizmodo.com/president-trump-accuses-google-of-rigging-search-result-1828647850

3 — https://github.com/codelucas/newspaper

4 — a how to on wordclouds with R — https://datascienceplus.com/building-wordclouds-in-r/

5 — info on documentmatrices — https://en.wikipedia.org/wiki/Document-term_matrix and how to generate them https://www.rdocumentation.org/packages/tm/versions/0.7-5/topics/TermDocumentMatrix

6 —AFINN sentiment lexicon http://corpustext.com/reference/sentiment_afinn.html

7 — SentimentR lib — https://cran.r-project.org/web/packages/sentimentr/README.html